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

display the descriptions of a multi value parm 1

Status
Not open for further replies.

kdk13

Programmer
Jul 3, 2002
23
US
I have a multiple value parameter set as a number type. The values of the parameter list are numbers, but I also have descriptions for each that are string values. I am displaying only the description for the users to select the parameters. The descriptions are not available in the database, nor can I add them in the database. Then I'm using the values in the record selection. That is all working fine.

What I now want is to list in a formula in my header the descriptions of the parameters chosen. Is there even a way to get the descriptions? Otherwise, I'd settle for a list of the values, and do some replaces. When I try to the Join({?MVPArray}, " ") formula, I get a message that it must be a string array. If I add totext it wants it to be subscripted. When I add subscripting, I get more errors or it only shows the one value I request in the subscript.

I can't make my parameter a string type, because then I have to do a tonumber({?MVPArray}) in my record select and it wants it subscripted and it probably still wouldn't work.

Any ideas?
 
Unfortunately you can't get the description used for the parameters, a nuisance to most, and typical of Crystal's parameter handling (weak).

Perhaps there's a means in CR XI, I'm not sure.

-k
 
You can hard code the descriptions into a formula like:

whileprintingrecords;
stringvar desc;
numbervar counter;
numbervar i := ubound({?parm});

for counter := 1 to i do(
desc := desc + (if {?parm}[counter] = 135 then "Filenes" else
if {?parm}[counter] = 246 then "Lord & Taylor" else
if {?parm}[counter] = 257 then "Macy's") + ", ";
left(desc,len(desc)-2);

-LB
 
Thanks, lbass! That worked great. I haven't worked with arrays much and would not have figured that out on my own.
 
Not sure what that buys, you still need to maintain the list, and it's all hardcoded, I think it would be simpler to just populate a text box with them.

-k
 
SV - I'm surprised you would say that. Clearly, what the formula does is identify only those descriptions that relate to the multiple parameters selected--which could not be simply added to a text box. Since the descriptions are not in a table anywhere, it is obvious that the formula will need to be updated as any new numeric codes and corresponding descriptions are added to the mix.

-LB
 
I understand, LB, but it doesn't do so dynamically.

I suppose that it's less work and that a text box isn't very good either, I'd look at a table driven solution as these things tend to get overlooked and don't offer sa long term solution to it.

-k
 
I do have my own schema in this database where I can add a table. Since I'm making more and more reports that need this decode from an ID to a text description, I will consider adding my own table and converting the reports - in my "spare" time. Luckily this particular list of choices is quite stable and isn't likely to change.

Thanks for all the help and suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top