0
votes

I have a report which displays rows of data from a stored procedure. On the top of the report I would like to display information about which parameters were used to produce the report. My issue is that several of the parameters are IDs for a foreign key relationship, but on the report I want to display a description instead of the ID. The description is stored in a lookup table, but I don't know how to do this lookup inside Crystal.

I am using Crystal Reports 2008.

Edit: I figured out I could do this using sub-reports, but that's sort of a PITA. I'd still appreciate it if anyone knows another way. I found SQL Expression Formulas also but Crystal won't let me use them because my data source is a stored procedure rather than a table.

2

2 Answers

1
votes

The sub-report is your best bet. Or, add the parameter description to the result set of your sp. It is a shame you cannot show the parameter's value and description. :(

I think if you try to add the lookup table to the report and use the parameter in the record selection, it will actually prompt for the parameter twice...once for the lookup table and again for the sp.

0
votes

Since the descriptions are in your result set, you can adjust for the nulls in your display formula: "Parameters: " & If isnull({1stDescription}) then "1st is null," else {1stDescription} & ", " & If isnull({2ndDescription}) then "2nd is null," else {2ndDescription} & ", " & If isnull({3rdDescription}) then "3rd is null," else {3rdDescription} & ", " & so on. this way you're not slowed down with sub-reports