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

How can I let my users leave the parameter blank in crystal reports

Status
Not open for further replies.
Jul 28, 2011
167
0
0
NG
Hi everyone,

I'm working on a report portal and I encountered an Issue.
I want users to be able to leave any of the parameter blank. I've tried this for the three major fields I have.
Code:
[COLOR=red]
if IsNull({?End Date}) then 
      {rectReport.Call date} in DateTimeValue('1753-01-01 00:00:00') to CurrentDateTime
    else   {rectReport.Call date} in {?Start Date} to {?End Date}
and 
if IsNull({?Engine Down}) then
        {rectReport.EngineDown} in 0 to 1
[/color]
What does anyone think I can do?
All responses are highly appreciated.

 
Please repost in an appropriate forum--forum149 or forum767. When you do, please also identify your Crystal Reports version.

-LB
 
As lbass says, you are in the wrong forum and should give your version, 8, 8.5, 9, 10, 11 or whatever. But the solution is simple, no need to post again. You have two options: either an extra parameter that lets you choose between Start-End or Start-Current, with formula fields doing much what you codeed, just testing the extra parameter.

The second option is to set the parameter default to some impossible value, e.g. 1/1/1000. You still use a formula field and in this case chose the default value. But that assumes there is some limit: I note you are going back as far as 1753.

Note also that you could select by whole years, using Year(your.date)

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top