Solved

Crystal Reports Parameter / Null question

Posted on 2006-07-12
5
253 Views
Last Modified: 2008-03-04
I am trying to create a parameter that can/cannot be used in a report. For some reason, if they don't put anything in the parameter, it prints everything, and if they do, it prints everything as well. I tried having the select expert only print records that were = to the parameter, but then it requires something in the parameter. Any clue on how I can include a parameter that if they enter something, it filters by, but if they leave blank, it prints everything?
0
Comment
Question by:hwgtech
5 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 17095213
Hi hwgtech,
I think the approach depends on which version of CR you have.

In CR11 you could set a default value for the parameter which would indicate no selection had been made.
Then in your record selection you would use a formula like:

If {?paramfield} = 999999 then   //999999 indicates 'all values'
true
else if {mytable.myfield} >{?paramfield} then
true
else
false

Pete
0
 
LVL 34

Expert Comment

by:James0628
ID: 17095564
Like Pete said, it may depend on which version of CR you're using, but in CR 10, I can use a formula in the record selection like the following and if I don't enter anything for the parameter, I get everything.

{?param} = "" or {field} = {?param}

 James
0
 

Author Comment

by:hwgtech
ID: 17096002
I am using 8.5 with saleslogix CRM. I tried both and nothing! Any other suggestions?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 17096660
Try something a little simpler

if {?MyParameter} = "ALL" then
  TRUE
else
   {table.MyField} = {?MyParameter}

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17267850
Glad i could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question