Wednesday, May 16, 2012

Change Group Name in Crystal Reports to non-Database Value using Formula

I am looking to change the group names in a crystal report to a specified text value not located within the database.

e.g. i have a 'status' field that can either be 'i' or 'a'. I would like these to display as 'inactive' or 'active' in the group headings. The code i currently have in the 'Use a formula as group name' is:

stringvar newGroupName;
if (groupname = "I") THEN newGroupName:= "Inactive" ELSE
if (groupname = "A") THEN newGroupName:= "Active" ELSE
newGroupName:= groupName;

However this says i am passing too few arguments for the groupName reserved word.

Have looked on the net but have not found anything for defining non database names using the groupname function. Any help greatly appreciated.

No comments:

Post a Comment