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

Parameter - defining value for all records

Status
Not open for further replies.

ddamsgaard

Technical User
Jun 30, 2003
12
0
0
I'm fairly new to Crystal.

Here's what I'd like to do. Suppose I have a field called Region with values 'North', 'South', 'East' and 'West'.

I'd like to create a parameter field to select, let's say, the 'East' region. Actually, I've done this part and it works fine. What I'd really like is to add a parameter value like 'All' which would run the report without any selection criteria. That is, from the parameter dialog box, I want to be able to either run the complete report or select a single region to run.

I've looked through the book 'Crystal Reports - The Complete Reference' and I don't see right off how to do this.

Thanks in advance.
 
Use the formula workshop to modify your selection criteria as follows..
{?Region} = "ALL" or
{Table.Region} = {?Region}

If you have additional selection criteria you need to bracket the above with the other clauses and then use AND

You can't do this in the Select Expert - it is too complex for it to display. The formula editor is where you have to do this

If you are using a number or date parameter you have to identify a value that is treated as "ALL". Then you can't select that value if it is in the database.

In the above, you can't find a region called "ALL" as that is now treated separately

Editor and Publisher of Crystal Clear
 
First off, thanks for your reply.

I confess I'm not sure I understand. In my original question, I talked about 'Region' with values 'North', etc. I did that to simplify the question.

In the real report, 'Region' corresponds to 'Business Group'. What I want to do is have the Business Group parameter either allow for a single member of the 'Business Group' to be selected and a report created for that group or create the report with all business groups.

I did figure out how to modify the selection criteria using the formula editor - so that's a plus.

Based on your input, I changed it to:

{TEST.Seg_IState_NonIState} = {?IState_NonIState} and
({?Business Group} = "ALL" or
{TEST.SegmentGroup} = {?Business Group})

But . . . when I run the report, I can only select a member of the Business Groups field. There still doesn't seem to be any way to print all the records.

If you have any further ideas, please let me know.

I appreciate your help - and again, thanks in advance.
 
You need to add "All" (without the quotes) to your parameter default list, and you probably want to toggle it so that it is the topmost (default) option.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top