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!

How to display multi value parameter on report header 1

Status
Not open for further replies.

khan007

Programmer
Jun 10, 2003
103
CA
I am on crystal 8.5, using Active X Control for crystal viewer. Database is SQL 2k and Win2k operating systemI need some help with displaying of multi value parameters on report headers.
I am using dynamic SQL to pass multi value parameters from Stored procedure to my reports. I need to know how I could display parameters on report header.

Suppose I have parameters employeeid, discipline and location as multivalue parameters.
Values are:
employeeid : (1000, 1002, 1004, 1005)
discipline : (OT, SP, PT, AUD)
Location : (BASE, UPPER, LOWER, MID)

I have no problem in dispalying 'Discipline' and 'location' as it is passed to report but my problem is i need to display each employeename on header instead of employeeid which has passed as parameter, like

employeename : (joe,1, joe,2, joe,3, joe,4)
Please let me know with any formula, idea or logic.
Thanks in advance.
 
At the report header time, the report doesn't know the employees, you'ree querying that information unless you're using a picklist for the parms, you can display the emp ID's as decriptions to the user, and then display the parms in the header.

Otherwise you might have to use a subreport to obtain them.

-k
 
I am using a picklist on UI side and saving it on a temp table and passing that string of employeeid to report.

From my understanding you are trying to say i can only display employeeid in this case
or
i need to pass employeename as a string also in order to display on report header.


.
 
If I understand your question properly...try the following. Create 3 formulas:

Formula: InitNameArray
-----------------------
BeforeReadingRecords;
Global NumberVar x := 0;
Global StringVar Array EmployeeNames;
1

Formula: AddToNameArray
------------------------
WhileReadingRecords;
Global NumberVar x := x + 1;
Global StringVar Array EmployeeNames;
Redim Preserve EmployeeNames [x];
EmployeeNames [x] := {Customers.CustomerID};

Formula: DisplayNameArray
--------------------------
WhilePrintingRecords;
global StringVar Array EmployeeNames;
Join(EmployeeNames)

Place the 1st and 3rd formulas in the report header and the 2nd formula in the details section. The key to the formulas is in the Evaluation Time arguments. The first two are exectured while the dataset is being read (i.e., 1st pass), while the 3rd is executed during the formatting (actually 2nd pass) of the report.

Hopefully this will either address your needs or at least point you in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top