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?
 
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
 
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.