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

Defaulting parameter selction

Status
Not open for further replies.

44veena

Technical User
Jun 24, 2002
15
US
Hi all,

In my report I would like to insert a parameter which is a date parameter. I would like to have two options,
1. if the user does not select any date range, the report should display all the records.
2. if the user selects the date range, for example 1/1/2002 to 4/1/2002, only records in those 3 months should be displayed.
Any suggestions would be of great help
 
So, you want to have the parameters pop up so that the user needs to enter them. But, if the user doesn't anything in for the parameter, you want it to include all records. Or, vice versa, if the user does enter parameter values, you want it to enter only those which they seek.

Could you just put a formulae in your report which says basically:

if parameter.value = null then
return all
else return values between said parameter values
end if

That is not real code (since I haven't worked with Crystal in a while), but the point is hopefully clear. I believe it's possible, but not 100% certain... HTH. Give me liberty, or give me pizza...
 
Make one parameter and make it a date range. Do not set any default values, and both the begining and ending dates will default to today. Then when the user runs the report they can select teh "No lower bound" checkbox and they will get everything through today. If they want a different range they just have to enter it.

Creating the parameter field is only part of the work, you must also use a record selection formula and tie the parameter values in with your database fields. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top