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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display 'ALL' if user selects all parameters in Dynamic Parameter 1

Status
Not open for further replies.

inspi

Technical User
May 24, 2006
50
US
Hi,

I'm using CR 2008 with a dynamic cascading parameter.
Name: {?@Division}
If the user selects ">>" to select all the LOV's in the first parameter box, then I want to display the parameter value as "All" in the report page header.

IS this possible in crystal 2008?
 
In XI, you can do this like this. Insert a subreport that uses a command as its datasource:

Select count(distinct "Division") "Total Divisions"
From "Owner"."Table"

(This is Oracle syntax.) Then add a formula to the subreport header:

whileprintingrecords;
stringvar divs;
numbervar i;
numbervar j := ubound({?@Division});
for i := 1 to j do(
if j = {Command.Total Divisions} then
divs := "All " else //add two spaces at the end
divs := divs + {?@Division}+", "
);
"Selected Divisions: "+ left(divs,len(divs)-2);

Link the sub to the main report by using the dropdown in the lower left of the subreport linking screen to select {?@Division}, not the default {?pm-?@Divison}.

The reason for using a sub is to avoid referencing any fields from the command in the main report, and you need to check the value of Total Divisions.

-LB
 
Worked perfectly. Thanks a lot LB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top