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

Parameter (This Array must be subscripted)

Status
Not open for further replies.

lumier

Programmer
May 21, 2004
4
CA
I have a parameter setup that has Allow multiple values selected. I need for the parameter to be able to select from the drop down of default values of one are more of the values or to leave it blank to select all values that are setup in the default values.

The default values does not contain all values in the field only selected values are needed.

If I remove the Allow multiple values, the report works fine, but I need for them to be able to choose from the default or leave blank for all. And if it is blank then it would pull all values in the default.

The below is what I have in select expert:
(if {?Name} <> "" then(
instr(UpperCase({?Name}), UpperCase({table.Name})) > 0)
else
true)

When I run the report, I get the message This Array must be subscripted.

Any suggestions would be appreciated.

I am on Crystal 8.5
 
Is a specific formula not hightlighted when you get this error. I thought when you clicked okay, the offending formula should open up in the editor.

If this is the case, you really want to post this.

Without it, I can make some assumptions, like ending the formula with "", or referencing a particular parameter value with {?Name}[n], where n is a number.

Naith
 
The information above is showing in select expert. When I run the report, select expert opens with the error:


(if {?Name} <> "" then(
instr(UpperCase({?Name}), UpperCase({table.Name})) > 0)
else
true)

The pointer is pointing in front of the below like there is an error with {?Name}.

{?Name}), UpperCase({table.Name})) > 0)
else
true)

This is setup as a string.

 
It's because you're trying to apply the UCase and InStr to the parameter. Are you unable to have the parameter replicate the value in the database, without switching the case etc?
 
First, selecting the default will not limit the values to those you have used in your default list, but instead, to all in the database. Also, you might want to set up an edit mask for the parameter entry so that the user always enters in upper case. You can do this by adding a mask of:

>CCCCCCCCCCCCCC //as many C's as there might be characters

Then use a SQL expression {%name} to get the field in uppercase:

{fn ucase({table.field})}

Then you can write a record selection formula that will pass to the SQL:

if {?parm} <> "" then
{%name} = {?parm} else
if {?parm} = "" then
{%name} in ["NAMEA","NAMEB","NAMEC"] //include all that are in your list

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top