Sue Taylor
asked on
Displaying multiple parameter fields
I have a parameter called {?Department} that is a numeric field. I have a small list of numbers with their descriptions next to it in the parameter.
209 = Joe Daivd
210=Raun Provost
211=Eduardo Villa
etc.
I have a formula called Title that has the following:
if {?Department} = 209 then "Joe David" else
if {?Department} = 210 then "Raun Provost" else
if {?Department} = 211 then "Eduardo Villa" else
if {?Department} = 212 then "Bobby Watson" else
if {?Department} = 213 then "Mike Harris - Days " else
if {?Department} = 214 then "Mike Harris - Nights " else
if {?Department} = 215 then "Forge - Nights " else
""
My select expert shows the following: {aptp_view_time_cards.card starttime_ ts} = {?Date Range} and
{empMain.department_id} = {?Department}
I have a formula called Title that I want to use the parameter field for the Department to display. I can get it to work if I have just one department. However, sometimes, I want to be able to display multiple departments at a time.
How do I get the "Title" to display all deparments?
Thank you,
Sue
Ratio-Report.rpt
209 = Joe Daivd
210=Raun Provost
211=Eduardo Villa
etc.
I have a formula called Title that has the following:
if {?Department} = 209 then "Joe David" else
if {?Department} = 210 then "Raun Provost" else
if {?Department} = 211 then "Eduardo Villa" else
if {?Department} = 212 then "Bobby Watson" else
if {?Department} = 213 then "Mike Harris - Days " else
if {?Department} = 214 then "Mike Harris - Nights " else
if {?Department} = 215 then "Forge - Nights " else
""
My select expert shows the following: {aptp_view_time_cards.card
{empMain.department_id} = {?Department}
I have a formula called Title that I want to use the parameter field for the Department to display. I can get it to work if I have just one department. However, sometimes, I want to be able to display multiple departments at a time.
How do I get the "Title" to display all deparments?
Thank you,
Sue
Ratio-Report.rpt
ASKER
I looked at this earlier. (You sent this link to me on another question and I have it saved in my favorites) I can get it to display the numeric field....but I want to change it to a string value.
I have tried this and get "a boolean is requred here. when it shows str [3 to Length(str)]
Local StringVar str := "";
Local NumberVar strLen := Count (InputNum);
Local NumberVar i;
For i := 1 to strLen
Step + 1
Do (str := str +', '+ ToText(InputNum ,0,''));
str [3 to Length(str)] <<<<<<<<<<<<<<<<< ERROR here.
and
if {?Department} = 209 then "Joe David" else
if {?Department} = 210 then "Raun Provost" else
if {?Department} = 211 then "Eduardo Villa" else
if {?Department} = 212 then "Bobby Watson" else
if {?Department} = 213 then "Mike Harris - Days " else
if {?Department} = 214 then "Mike Harris - Nights " else
if {?Department} = 215 then "Forge - Nights " else
""
I have tried this and get "a boolean is requred here. when it shows str [3 to Length(str)]
Local StringVar str := "";
Local NumberVar strLen := Count (InputNum);
Local NumberVar i;
For i := 1 to strLen
Step + 1
Do (str := str +', '+ ToText(InputNum ,0,''));
str [3 to Length(str)] <<<<<<<<<<<<<<<<< ERROR here.
and
if {?Department} = 209 then "Joe David" else
if {?Department} = 210 then "Raun Provost" else
if {?Department} = 211 then "Eduardo Villa" else
if {?Department} = 212 then "Bobby Watson" else
if {?Department} = 213 then "Mike Harris - Days " else
if {?Department} = 214 then "Mike Harris - Nights " else
if {?Department} = 215 then "Forge - Nights " else
""
If you use Crystal Reports 2008 SP5 then you can display the description from the actual parameter, not just the value. No special code needed :) Check out the "What's new..." document:
http://help.sap.com/businessobject/product_guides/boexir31SP5/en/xi31_sp5_whats_new_en.pdf
http://help.sap.com/businessobject/product_guides/boexir31SP5/en/xi31_sp5_whats_new_en.pdf
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I can't use the method above.
mlmmc, I get an error ...... Missing ) and it highlights (InputNum) on row 2 of your formula.
mlmmc, I get an error ...... Missing ) and it highlights (InputNum) on row 2 of your formula.
Try UBound
mlmcc
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As soon as I put those first two lines back in the formula, it worked just as I wanted.
Thanks mlmcc and James
Thanks mlmcc and James
You're welcome. Glad I could help.
James
James
http://www.kenhamady.com/form07.shtml
Open in new window
mlmcc