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!

displaying parameters 1

Status
Not open for further replies.

dreamboy27

Programmer
Sep 25, 2006
16
0
0
US
hi friends
i have a problem in displaying all the text parameters to displaying on the main report like i took the team number as my primary key and want to display all the team names on the report header seperated by a comma. i had tried using subreports but it is displaying each team in different row like
PBS
MCO
FLU
i want 2 display as
PBS,MCO,FLU

please help me urgent
 
Bit of a language barrier I guess.

What do keys have to do with displaying parameters?

Using real technical terms is critical to our understanding your requirements, mixing up various terms will just confuse us.

To display a multiple value parameter as comma delimited text, use:

join({?MyParameter},", ")

If you want to display values within the table in the report header, you're in trouble because thos values haven't been processed yet in the report header.

I suggest that you take the time to post basic technical information and requiements, then if you'd like you can chat about what you tried and show use what you don't want.

Please include:

Crystal version
Database/connectivity used
Example data (fields, example of the contents, you sorta did this)
Expected output

-k
 
You can either hard code the descriptions in a formula like:

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

for i := 1 to j do(
display := display + (
if {?parm} = 1 then "Chocolate" else
if {?parm} = 2 then "Strawberry" else
if {?parm} = 3 then "Vanilla"
) + ", ");
left(display, len(display)-2)

Or you can use a subreport which is linked to the main report on the parameter field which you also must create within the subreport and use in the subreport record selection formula. Then place the description field in the detail section and create two formulas:

//{@accum} for the detail section:
whileprintingrecords;
stringvar desc;
if instr(desc,{table.flavor}) = 0 then
desc := desc + {table.flavor} + ", ";

//{@display} for the subreport footer:
whileprintingrecords;
stringvar desc;
"Selected Flavors: "+left(desc,len(desc)-2);

Then suppress all sections of the subreport except the subreport footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top