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

Displaying Parameter translations (not numbers) in Report Header

Status
Not open for further replies.

gonzo27

Technical User
Mar 6, 2008
10
US
Hello,

I have a numeric parameter that I was able to create a display formula for (join function would not work with this parameter) to get all the selected values to show. However, now I would like the translations and not the actual selected values to appear.

For example, I currently have the following displaying
"Order Types: 1001,1002,1015,1016"

I would like it to read...
"Order Types: Lab Initiated, Routine etc...."

The "order_type_c" field being used in the selection criteria is a number (and so is the corresponding "order_type" field in the CATEGORY table that is being used for the parameter) How do I get the "Name" field that is right next to "order_type" to appear in the diplay formula on the report header instead of the actual numbers???

Thanks,
g

PS. This is a huge and dynamic parameter so hardcoding the translations is not an option
 
Please post the "display formula" that you are using now.
 
You also need to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry about that (First Time)
It's Crystal XI
and here is the formula that finally allowed all the parameters to display...

numbervar counter;
stringvar display;

for counter := 1 to count({?Order Type}) do (
display := display + totext({?Order Type}[counter],0,"") + ", ");
left(display, len(display)-2);
 
If you have a large number of values, then you should insert a subreport that is linked to the main report on the parameter. The subreport should only reference the table containing the code and description. Then display the description field in the detail field and suppress all other sections.

-LB
 
thanks lbass, but is there anyway to display the "names" in the header? otherwise I could just have dropped the names on the report, thing is they didn't ask for it to be included on the report but I would like them to see what order types they selected. I know it doesn't make a lot of sense but that's how it was requested...

your suggestion would show the order type names for each detail record correct? same as just dropping the name field on the report right?

I tried inserting the name field into my above formula as follows..

numbervar counter;
stringvar display;
for counter := 1 to count({?Order Type}) do (
display := display + totext({?Order Type}[counter],0,"") + " - " + {ZC_ORDER_TYPE.NAME}+", ");
left(display, len(display)-2);

It's giving me "1000 - Bloodbank, 1001 - Bloodbank, 1015 - Bloodbank" so it seems to be picking the first translation and assigning it to every value -but at least it's giving me hope :)
 
No, you misunderstand. You don't need any formula. Insert a subreport that uses the ZC_ORDER TYPE table, which should include both a code and a description, right? Add the description to the detail section, or if it repeats, insert a group on the description field and suppress all other sections. Then go to edit->subreport link->and move the parameter field from the main report to the right at the top of the box. At the bottom, you will see {?pm-?Parameter} and there will be a check mark saying "select data in subreport based on field" and it should show the code field in the bottom right.

-LB
 
I think that LB is suggesting you create a STAND-ALONE subreport that just does the display of the order-type, and insert it as a section in your HEADER.

A simple report that looks for {CATEGORY.order_type_name} where {CATEGORY.order_type_number} matches the linked-param list from your main report.

You don't need to look at the other tables that are giving you transactional info.
 
The subreport (with Parameter link) works...

Thank You!
g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top