Solved

subscript must be between 1 and the size of the array

Posted on 2004-09-21
3
404 Views
Last Modified: 2012-06-21
This is my record selection formula
  or
    (
      If {?a}[1]= "test" then
      (
        ({table.field}=0)
      )
    )  
    or
    (
     
      If {?a}[2]= "test1" then
      (
        ({table.field}=1)
      )
    )  
    or
    (
      If {?a}[3]= "test2" then
      (
        ({table.field}=2)
      )
    )  

This parameter field {?a} is a multiple selection criteria.

if i add only "test" as a parameter value I get an error subscript must be between 1 and the size of the array at this line If {?a}[2]= "test1" then

0
Comment
Question by:PradeepYadhav
3 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 500 total points
ID: 12114168
The problem is that you are trying to check for an element of the range parameter that doesn't exist.

You would be better off taking a different approach.
Start off by editing your parameter.
I assume you have default values for the user to pick from.
Since the textual description doesn't match the value stored, you can set up description and values paris for the default values.
The description will be displayed for the user to choose from, and the value will be used in the selection criteria.
Add 0 to your default list, then highlight it, and click the Define Descirpiton button.
Add the description "test" in the description box.
Repeat these last 2 steps for each value you need.
There is a drop down list underneath the default values called Display.  Change this to Description.
Save and Close the parameter dialog box.

Now, all you need for your record selection is:

 {table.field} = {?a}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now