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

Displaying Parameter List 2

Status
Not open for further replies.

rkeyser

Programmer
Mar 23, 2003
5
US
In CR 8.5, I see how to define a parameter which allows multiple values to be chosen. I assume such a parameter is an array of strings. In the Report Header, I would like to display the parameters the user chose. I can easily display the first, but how do I show the others?

Thanks.
 
You can use the following formula:

Local NumberVar i:= 1;
Local NumberVar loops := UBound({parameter})
Local StringVar Display;

For i := 1 to loops do
(
Display := Display + {parameter} + iif(i<loops, &quot;,&quot;,iif(i=loops-1, &quot; and &quot;, &quot;.&quot;))
);
Display

This basically loops through the parameter, which is an array, and pulls out the values and stores them in the Display variable. The iif function is concatenating, commas b/w the values, &quot;and&quot; for the 2nd last one and full stop at the end. You can vary this any way you like but this basic For Do Loop should give you want you want.

cheers..J

 
A much easier solution is to use the join() function, if this is a string parameter.

Join({?YourMVParameterField},&quot;,&quot;) will return a string with every value supplied via the prompt, separated by a comma. This formula will return an error if the string result is greater than 255 characters in v8.5. This limitation has been raised to 64,000 characters in v9. Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
I appreciate both of you responding so quickly.

I chose the &quot;Join&quot; solution, as that was enough for this little project. It worked perfectly.

I'm glad to find a CR Forum that is responsive and well informed.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top