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

Crystal Reports8.5: Displaying multiple parameters 1

Status
Not open for further replies.

greengo204

Technical User
Apr 7, 2009
56
AU
HI,

For displaying Multiple Discrete values separated by a comma, i generally use the below formula:

Code:
whileprintingrecords;
stringvar Output:="";
numbervar Counter;
For Counter := 1 to ubound({?MyNumericParameter}) do(
Output:= Output& totext({?MyNumericParameter}[Counter],0,"")& ","
);
left(Output,len(Output)-1)

see
Which works perfect normally. What i would like to do a display the parameters after i have used an if...then...else formula.

e.g.

the number/s displayed in the parameter relate to a company number, i would like to diplay the company name and not the number.

formula for company name:
Code:
if {po_cmpny.icc_cmpny_id} = 1 then "X" 
else if {po_cmpny.icc_cmpny_id} = 24144 then "Y"
else if {po_cmpny.icc_cmpny_id} = 24145 then "Z"
else if {po_cmpny.icc_cmpny_id} = 38299 then "A"
else "ERROR"

I have attempted this a number of times unsuccessfully.

Could anyone suggest a way of achieving the above?

Any suggestions would be appreciated.


Cheers
 
whileprintingrecords;
stringvar Output:="";
numbervar Counter;
For Counter := 1 to ubound({?MyNumericParameter}) do(
Output:= Output&
(
if {?MyNumericParameter}[Counter] = 1 then "X"
else if {?MyNumericParameter}[Counter] = 24144 then "Y"
else if {?MyNumericParameter}[Counter] = 24145 then "Z"
else if {?MyNumericParameter}[Counter] = 38299 then "A"
else "ERROR"
) & ","
);
left(Output,len(Output)-1)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top