Print Page | Close Window

Dynamic grouping attempt

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13228
Printed Date: 01 May 2024 at 7:14pm


Topic: Dynamic grouping attempt
Posted By: omniholy
Subject: Dynamic grouping attempt
Date Posted: 16 May 2011 at 9:12am
If {?GroupBy} = "Runs" then
    {Table.runName}
Else  
    {Table.vehicleId}

I have been trying to allow grouping by user selection.  The formula workshop keeps saying there is an error in the formula.  I can't figure out what the error is.  I made the two groups, one by runName, one by vehicleId.

I'm using Crystal Reports XI.

Thanks in advance.



Replies:
Posted By: Keikoku
Date Posted: 16 May 2011 at 10:03am
The formula workshop keeps saying there is an error in the formula.


What is the error message?

My guess is that it highlights {Table.vehicleId} and tells you it expects a string.

That would be because a formula can only return one type of variable.

Convert any non-string variables to string. Or whatever type should be returned.


Posted By: omniholy
Date Posted: 16 May 2011 at 11:13am
Thank you.  The error message did not specify what the error was.  That was the problem however.



Print Page | Close Window