Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Group my formula fields?

Status
Not open for further replies.

CherrySoda

Technical User
Jun 5, 2008
16
US
Crystal v.10

I have a formula field in my report that uses a global variable and some if statements. I want to group using this field, but it is not an available field in Group Expert. I thought it might have been the If Statements in the formula, so I then created a simple formula that prints "Hello" and that won't show up in Group Expert either.

Any idea why these will not show up for me to group?
 
Please show the contents of the formula and indicate in what section it is located
 
Here is my formula. It is placed into details of the report. The reason for the global variable is because some the the ACTIVITY fields are null and I want them assigned the most recent used value for CODE. The formula works just fine, but it just wont show up in the Group Selection box.

global stringvar CODE;

whileprintingrecords;
CODE;

if (isnull({ACTIVITY.ACTIVITY_CODE})) or ({ACTIVITY.ACTIVITY_CODE} = "") then
CODE
else if not isnull({ACTIVITY.ACTIVITY_CODE}) then
CODE := {ACTIVITY.ACTIVITY_CODE}
else CODE := "ERROR
 
Any idea on what I can do to group this formula field?
 
You don't need a variable for this, and your whileprintingrecords is the problem. Use a formula like this:

if isnull({ACTIVITY.ACTIVITY_CODE})) or {ACTIVITY.ACTIVITY_CODE} = "" then
"ERROR" else
{ACTIVITY.ACTIVITY_CODE}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top