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

list all the values from my parameter in my crystal report

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
If I have a dynamic cascading prompt, and in that prompt I have allowed my users to select more then one facility, by code (as the value), and then by name (in the description). I would like to display in my Crystal report all the names (descriptions) of the facilities they pick whether it be one or more, How can I do this easily?
 
The simplest way would be to insert a subreport that is linked to the main report on {?facilitycode} and then in the sub only use the table that contains the facilities. Add the description field to the detail section and then suppress the other sections.

-LB
 
Can I do this with a formula? I was thinking something like this:

numbervar max := count({?Multiple MBO - Unit});
numbervar k := 1;
stringvar output := "";
for k := 1 to max do
(
output := output + {?Multiple MBO - Unit}[k]+", "
);
numbervar m := len(output);
left(output,m-1)

except that my dynamic cascading prompt has three different value fields, along with three different description fields. The Best example of this would be:

OH- Ohio
CIN- Cincinnati
WC- West Chester

What I want to capture is the “Ohio” (the first description, in the cascading prompts)
 
Yes, I just assumed you had more than three values. Change the formula to:

numbervar i;
numbervar j := ubound({?Multiple MBO - Unit});
stringvar x;
for i := 1 to j do(
x := x + (
if {?Multiple MBO - Unit} = "OH" then
"Ohio" else
if {?Multiple MBO - Unit} = "CIN" then
"Cinncinnati" else
if {?Multiple MBO - Unit} = "WC" then
"West Chester"
)+", "
);
left(x,len(x)-2)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top