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!

All but one parameters in report are optional.

Status
Not open for further replies.

lpbruce1

MIS
Aug 2, 2004
15
0
0
US
Hi -

I am using Crystal XI and I need help setting up 4 parameters. Depending on the imput will determine which parameters are used.

These are the parameters I am using.
?ClientID
?FromDate
?ToDate
?RefernceID

Here is what I need..

~ {?ClientID} is required.
~ {?FromDate} is required only if either a {?FromDate} and {?ToDate} is entered or NO {?ReferenceID} is choosen or they choose "All" for the {?ReferenceID}.
~ {?ToDate} is required only if either a {?ToDate} and {?FromDate} is entered or NO {?ReferenceID} is choosen or they choose "All" for the {?ReferenceID}.
~ {?ReferenceID} is Required is a {?FromDate} and {?ToDate} is not Entered.

I have tried different ways to try and set this up, but I cannot find the correct formula to put in the Selection Formula.

Any ideas..??


Thank you for any assistance.

Lisa Bruce
 
Code:
{Client} = {?ClientID} AND 
(
{{Date_Field} >= {?FromDate} OR ({?FromDate}="default value" AND all the conditions that make FromDate optional)
)
AND
(
{{Date_Field} <= {?ToDate} OR ({?ToDate}="default value" AND all the conditions that make ToDate optional)
)
AND
(
{RefIF}={?ReferenceID} OR ({?ReferenceID}="default value" AND all the conditions that make ReferenceiD optional)
)

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido - Thanks for your help. This code works except for the Date Parameters:
{{Date_Field} >= {?FromDate} OR ({?FromDate}="default value" AND all the conditions that make FromDate optional)
)
AND
(
{{Date_Field} <= {?ToDate} OR ({?ToDate}="default value" AND all the conditions that make ToDate optional)

The {?FromDate} and {?ToDate} default values would be the Minimum and Maximum dates in the {Orders.Order Date} field, which would change.

I tried to use:
({Orders.Order Date} >= {?FromDate} OR ({?FromDate}= minimum({Orders.Order Date}))
AND
(
{Orders.Order Date} <= {?ToDate} OR ({maximum({Orders.Order Date}))

But this generated an error that function (min and max) could not be used because it has to be evaluated later.

Any ideas on how I could do this, if the no From or To dates are choosen then choose the minimum and maximum dates?

Also, I don't know if this makes a difference but the data source is from a BO Universe.

Thanks Again,

Lisa
 
Move it to the Group selection formula (instead of Record selection formula) or use it to suppress/show sections.

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top