Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 312923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:03:38+00:00 2026-05-12T08:03:38+00:00

We have a Crystal Report that lets the user pick which of several fields

  • 0

We have a Crystal Report that lets the user pick which of several fields to filter against. In the record selection formula, we have code like the following:

if {?First Selection Type} = "CUSTOMER CODE" then {foo.CustCode} in {?First Selection Value} 
 else if {?First Selection Type} = "ORDER" then {bar.OrderNum} in {?First Selection Value}
 ...

The {?First Selection Value} parameter is defined as a multiple string parameter, since some of the choices need to use strings.

Unfortunately, the bar.OrderNum field is numeric.

If I try to put in the code as above, Crystal Reports gives the error “A number range is required here”.

If I put CStr({bar.OrderNum}) it saves without errors, but does not include that criteria when generating the SQL statement, resulting in atrocious performance as it pulls every order down from the database and searches them client side.

If I put ToNumber({?First Selection Value}) or CDbl({?First Selection Value}), it gives the error “This array must be subscripted. For example: Array [i].”

I need some way to make this criteria go to the database server, without making the parameters more confusing for the users.

In case it matters, we are using Crystal Reports 11.0.0.895 against a Progress OpenEdge 10.1B03 database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:03:38+00:00Added an answer on May 12, 2026 at 8:03 am

    The solution I found that seems to work is to create a SQL Expression named OrderNumStr with the following expression:

    CAST("bar1"."SOrderNum" AS VARCHAR(10))
    

    and then change the record selection to:

    if {?First Selection Type} = "CUSTOMER CODE" then {foo.CustCode} in {?First Selection Value} 
     else if {?First Selection Type} = "ORDER" then {%OrderNumStr} in {?First Selection Value}
     ...
    

    This at least sent the criteria to the server side, though it is preventing the database server from using indexes, so it is not ideal. It is still a massive performance improvement over what it was doing before.

    P.S. (I needed to rename the table from bar to bar1 in the database expert to get the SQL expression to work. This may be Progress specific though.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a crystal report which when generated has a last page that is
I have a crystal report with a bunch of parameterized fields that are being
Version: Crystal Report 2008 I have 2 parameters that prompt the user to enter
I have a Crystal Report that looks like: Date | Person | Ticket |
I have a crystal report that is like this: Group By Property.ID Group By
I have a crystal report that I have to add a Bar Code to.
I have a Crystal Report, that is populated with a stored procedure, it also
I have a report that I created with Crystal Reports 2008. This report uses
I have an existing report (Crystal Report) in my Visual Studio project that is
I have a crystal report that shows sales volumes called week to date volume.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.