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 handle Multi Value Parameters in CR 8.5

Status
Not open for further replies.

khan007

Programmer
Jun 10, 2003
103
CA
I am on CR 8.5, WIN 2k, Active x viewer, JSP environment.

I am facing problems to display data with multi value parameters.

I have reports with parameters location and patients.

I am running it from a JSP page and it is parameter driven.

Initially our only options from web page were either display one or all, means either one location or all locations, and one patient or all patients.

Now we changed our UI and user gets a pick list to choose from. The list is predefined and has all the possible selections of locations or patients they can choose.

Initially my code in selection formula was:

// we used ‘0’ for all option.

(
if {?Location} = '0' then
{table.Location} = {table.Location}
else
{table.Location} = {?Location}
)

and

(
if {?Patientnumber} = '0' then
{table.Patientnumber} = {table.Patientnumber}
else
{table.Patientnumber } = {?Patientnumber}
)

Now my questions is how could I handle multi values parameters in my report.
For example, if user pick five patientnumber 234, 345, 456, 546, 456 and three location base1, base2, base3 then how I am I going to retrieve these parameters in my report and query my selection formula.

Please inform me how could i pass multi value fields in crystal reports.

Thanks in advance
 
This same code should work, though I'd alter it to try to assure that the SQL is passed to the database:

(
if {?Location} <> '0' then
{table.Location} = {?Location}
else if {?Location} = '0' then
true
)
and
(
if {?Patientnumber} <> '0' then
{table.Patientnumber } = {?Patientnumber}
else if {?Patientnumber} = '0' then
true
)

Test the theory within the Crystal Reports designer by inserting the above into the record selection formula, adn then selecting Database->Show SQL Query.

When you enter multiple values, they should all be demonstrated in the SQL.

-k
 
I inserted the above code and ran the report on designer.
but I don't know how to pass multi values in parameters, either seperated by comma or ......
Because problem is that, I am not using &quot;allow mutiple values&quot; option in my parameters in report, i am passing them from UI and i don't want crystal pop up to ask me for my parameters. once parameters picked from list in web page, it should directly opens crystal report, without asking for parameters.

We had this feature earlier in our crystal reports for multivalues by allowing multiple values option but now we don't wan crystal viewer to ask for parameters, we designed our own web page on jsp.

I don't know, am i able to explain you clearly but trying my best.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top