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

How to display a string of selected numeric parameter?

Status
Not open for further replies.

Corres

Technical User
Jun 13, 2006
87
0
0
CA
CR XI, Oracle

I have fields PROGRAM_ID and PROGRAM_NAME. The parameter is PROGRAM_ID (numeric).

I want to display on the report a name of the program (string) for the PROGRAM_ID that the user selected as parameter.

Pls help me with the formula. Thanks very much!!
 
The approach you would take depends upon how many programs you are dealing. If only a few, write a formula like this:

numbervar i;
numbervar j := ubound({?program});
stringvar display;

for i := 1 to j do(
display := display + (
if {?program} = 33 then "Program 1" else
if {?program} = 34 then "Program 2" else
"Other"
) + ", "
);
left(display, len(display)-2)

Otherwise insert a subreport that is linked to the main report on {?program}, and which is grouped on program name, with all other sections suppressed.

-LB
 
Thanks very much LB, I gained so much knowledge from your sharing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top