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

thread767-711462 - IF CONTAINED FROM PARAMETER

Status
Not open for further replies.

mathews1

IS-IT--Management
Nov 14, 2005
17
CA
-crystal report 9
-SQL SERVER

I tried to pull items using instruction in thread767-711462. it works fine if I am pulling with one descrete value but it doesn't work if I am using multiple values or range of value. if I am changing prameter from descrete value to range or multiple values, it is giving me following error " This array must be subscipted"

In my record selection I am using the follwing restrictions;
{SOP30300.ITEMDESC} like "*"&{?Searchvalue}&"*"

-G
 
Yeah, that's a tricky one as you want to use LIKE with multiples, and Crystal doesn't parse it out when an array is referenced as the parameter.

A simple workaround might be to create numerous parameters, and then use:

{SOP30300.ITEMDESC} like "*"&{?Searchvalue1}&"*"
or
{SOP30300.ITEMDESC} like "*"&{?Searchvalue2}&"*"
or
... you get the idea...

A range should be easy enough to code, but multiple descrete is tricky.

-k
 
yeah, it is tricky to create numerous parameters. is there other way to handle this

-g
 
Actually my boss wants to enter at least ten different multiple values to pull the report and setting up ten or more parameters are very messy. Please help me to resolve this

-g
 
OK, this works as a record selection and pases to the database (CR XI, previous versions may not pass to the database):

(
if ubound({?MyArray}) > 0 then
{Employee.Emergency Contact Last Name} like "*" & {?MyArray}[1] & "*"
)
or
(
if ubound({?MyArray}) > 1 then
{Employee.Emergency Contact Last Name} like "*" & {?MyArray}[2] & "*"
)
etc...

MyArray is your multiple value array, and replace the field name with yours, I tested against a sample Crystal report.

-k
 
Thanks for your reply.

it means I need to create separate parameters for each
?MyArray like MyArray[1] and MyArray[2]

-g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top