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 use multivalue parameters with 8.5 runtime

Status
Not open for further replies.

okkolmi

Technical User
Aug 3, 2006
2
0
0
FI
Hi,

There might be a simple solution for this but since i am new to crystal, i can't seem to be able to solve this.

Background: crystal 8.5 runtime (crpe32.dll),Sql server 2000 database and Delphi application.

Problem:

We have an Delphi application which uses Crystal for reporting. Our application asks for parameter values and sends them to Crystal runtime when calling the report.

Delphi application is sending a multiselected parameter as string (csv for example 1,2,3).

I want to use this parameter in Crystal simply to restrict the data that is retrieved from the database.

In Crystal i have created parameter P_HourType and tagged
Allow multiple values and discrete values.

In select expert i have {Mytable.Myfield} = {?P_Hourtype}

This works just fine when running in Crystal developper but
when i run the same report through the runtime it does not show any values if more than one code was selected ( i.e parameter has multiple values).

I have tried to search for solution from this forum but so far i have not been able to find one.

Please can someone tell me what i am doing wrong ?
 
A very simplified example, based on code from the UCrpe32.hlp file:
Code:
Crpe1.ReportName := 'C:\Company.rpt';

if Crpe1.ParamFields[0].Info.AllowMultipleValues then
begin
  {Add two items to the CurrentValues list}
  Crpe1.ParamFields[0].CurrentValues.Clear;
  Crpe1.ParamFields[0].CurrentValues.Add('Atkinson');
  Crpe1.ParamFields[0].CurrentValues.Add('Jones');

Crpe1.Show;
-dave
 
Hi,

Thank you both for the answers.

So if i understod correctly, this can only be fixed in our Delphi app, and the is nothing i can do to fix this in Crystal?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top