Optional Parameters in Crystal Reports

In Crystal 2008, I have 2 parameters defined, but want to make it them optional, meaning they can use one or the other or both.
Here is my expression in the select expert:

{@check} <> 0.00 or
({@check date} in {?Start Date} to {?End Date}) or
{Command.STATUS} = {?Status}

Any thoughts on how I can do this?

Thanks
metalteckAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Set them as optional in the parameter screen.

In the filter use the HASVALUE test

{@check} <> 0.00 
or
((
    Not HasValue({?Start Date}) 
    OR
  {@check date} >= {?Start Date}
)
AND
(
   Not HasValue({?End Date}) 
   or
   {@check date} <= {?End Date} 
))
OR
(
   Not HasValue({?Status})
   OR
   {Command.STATUS} = {?Status}
)

Open in new window


mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
frankhelkCommented:
There's another way: You could set a default value for them, that would prevent "missing parameter" nagging when viewing the report.

The decision about the better way depends on how you use the parameters in your your report.
0
James0628Commented:
Do you really want OR after the test on @check ?

 Are you looking for the records where {@check} <> 0.00, _or_ the fields match one or both of your parameters?  Or are you looking for the records where {@check} <> 0.00, _and_ the fields match one or both of your parameters?

 Just checking.

 James
0
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

frankhelkCommented:
The "default value" solution would work seamless if you set {?Start Date} to something very early, like 01.01.0100 00:00:00 and {?End Date} to something very far in the future, like 31.12.9999.

Both default values would act in your filter quasi like "condition non existent".
0
frankhelkCommented:
Any hidden detail questions left unanswered ?
0
mlmccCommented:
I've requested that this question be closed as follows:

Accepted answer: 250 points for mlmcc's comment #a40726744
Assisted answer: 250 points for frankhelk's comment #a40726840

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.