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

Parameter fields with default of ALL? Crystal 7

Status
Not open for further replies.

Kperkins

Technical User
Mar 31, 2000
7
US
I have read several of the posts explaining the logic of using multiple parameter fields, and being able to only use one or two of them and have the other parameters default to "ALL".

My question is, if I am not using a list, how do a get it to default to all?

For example, I am creating a report that has four separate parameter fields: buyer name, vendor name, item #, date. I would like to be able to run this report for any of those selections individually, or default to all to include all open items.

I do not use drop down lists for the parameter prompts, I allow the user to enter the data (i.e. part number )- How do I create a parameter field that defaults to ALL, and then use the if then in the selection criteria?

Do I have to create a formula field to base the parameter field on? If so, I need help! Thank you for any you can provide!

Kristen

 
I haven't tried to combine more than one parameter boolean, but this is how you would do it, I believe. First, create your four parameters with 'All' as the default value. Next, try a variation of the following example statement in your record selection criteria:

//Multi-parameter selection criteria passed to the DB
//'Like' can also be used instead of '=' if required
//First Boolean Parameter – Buyer Name

(
If
{?BuyerName} <> &quot;All&quot;
Then
{table.buyername} = {?BuyerName}
Else
True
)

and

//Second Boolean Parameter – Vendor Name
(
If
{?VendorName} <> &quot;All&quot;
Then
{table.vendorname} = {?VendorName}
Else
True
)

and

//Third Boolean Parameter – Item Number
(
If
{?ItemNumber} <> &quot;All&quot;
Then
{table.itemnumber} = {?ItemNumber}
Else
True
)

and

//Fourth Boolean Parameter – Date
(
If
{?Date} <> &quot;All&quot;
Then
{table.date} = {?Date}
Else
True
)

I just cobbled this together from memory, so somebody please correct me if this is incorrect.
 
Thank you for your help - but I actually need to know how to create a parameters with 'All' as the default value??

I do not want to create a list - I want them to enter the data in the prompt, and if they are not going to use that particular prompt, select all.

I am using Crystal 7.0

Thank you for your help! I want to use your fomula - and have tried it - but it will not work, so I am assuming I have not set-up the default value of &quot;all&quot; correctly?
 
In my example, you would type in 'All' as the only value in the parameter list. You don't need to enter any other values in the list if you don't want to.

Alternately, you could leave the parameter list totally blank. If you did so then try altering the record selection like this:

(
If
Not IsNull({?BuyerName})
Then
{table.buyername} = {?BuyerName}
Else
True
)
 
Too add a parameter with a default value of all, click on insert, field object, parameter field, name the parameter, click on defualt values, and make &quot;ALL&quot; the default value. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top