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!

Multiple parameter values descriptions in report header 3

Status
Not open for further replies.

flaimster

MIS
Jul 2, 2001
14
US
thread767-1698120

Hello, I have a report that allows for multiple parameter values (numeric) to be entered. I have the formula to display the id fields in the report header but can't figure out how to get the corresponding table lookup name field for each id entered. For instance, a user can enter 3 different departments (10,11,25) which links to department id. I would like to display in the header the name of each departments selected: 10-Hardware, 11-Plumbing, 25-Flooring. Any help would be appreciated. Thanks
 
You say the dept. field is linked to department id. Is the department id another table? Does that table contain a description field with the name of the dept.? If so, you should be able to to put the description field in the report header. Now that I type that I think you want it in either the page header or a group header?
 
Or not so clean, is to create a formula that looks the the department ID and returns the appropriate value (i.e., if {deparmentID} = 10 then "10-Hardward" else if {deparmentID} = 11 then "11-Plumbing", etc.). FYI: This is one possible solution.
 
LaurieHamlin: I am trying to get it to show in the Report Header - not page and not group.
kray4660: There are too many potential departments for that solution to work. thanks

 
So is there a linked table that has the descriptions? If so, then it should be easy to drop in a text box and the two fields with a hyphen in the middle. Otherwise I do not know of an easy solution.
 
There is a linked table. However when I added the field it doesn't go thru the array and give description for each ID. Unless I don't know the correct formula
 
Okay I am assuming that the linked table is indeed linked in the Database Expert correctly. Thus if you put the ID (should not matter which table) and the description in a text box, I would think they would display correctly (are you filtering by department?). Not sure why you are talking about an array.
 
I haven't tested this but the only way I can see to do this would be to create a sub report that contains the Department lookup table and displays the parameter selection they way you want it. Place the sub report in the report header and pass the parameter of the main report into it.

Hope this helps.

Cheers
Pete
 
kray4660: I mention arrays because that is how the multiple value parameter would be displayed in the report header. If you don't do an array, you will only see the first value instead on all of them.
 
For other reading this post, CR 2016 has a special function now just for grabbing the descriptions from a parameter:

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top