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

Parameter in report header

Status
Not open for further replies.

JoyCR9

MIS
Jan 13, 2004
70
CA
In Crystal Reports 9, on oracle/sql/unix, I have a parameter that lists part ids: (Part.Part_id). When I run the report I enter a list of part numbers I want to query.

Works great.

However I want to have that list of part numbers display in my report title. I have done this with date ranges but can't seem to figure out how to get this with a listing.

Suggestions?
 
There are numerous ways, I have a FAQ on this:

faq767-5684

Basically you want:

join({?MyStringParameter},",")

-k
 
Thanks for your FAQ. I ended up doing the following as it is a numerical parameter:

whileprintingrecords;
stringvar Output:="";
numbervar Counter;
numbervar uboundminusone;
uboundminusone:=ubound({?Part numbers}) -1;
For Counter := 1 to uboundminusone
do(Output:= Output& totext({?Part numbers}[Counter],0,"")& ", "
);
Output:= Output& totext({?Part numbers}[ubound({?Part numbers})],0,"");
left(Output,len(Output))
 
You basically did the same thing only you processed the ubound separately, rather than truncating the final string ouput by one. The following is the same:

whileprintingrecords;
stringvar Output:="";
numbervar Counter;
For Counter := 1 to ubound({?MyNumericParameter}) do(
Output:= Output& totext({?MyNumericParameter}[Counter],0,"")& ","
);
left(Output,len(Output)-1)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top