Parameter with Value, or Null or empty sting.

Posted on 2013-05-17
Last Modified: 2013-05-25
I have a question regarding parameter that could have value or Null value or empty string “” value.

For example I have report with four fields: field1,field2,field3,field4.
For every field I  have parmeter Par1,Par2,Par3,Par4.

I understand that parameter is filter applied in selection criteria against a field.
Records will be selected based on value or values of the parameter or parameters for the field or fields.

Sometimes user asks for option to have specific values, multiple values or All values option for particular parameter.
I am ok with that  situation and I know how to provide it and what this selection will bring back.

However I was not sure about situation when there are scenario that in the same filed could be values and could be null values too and user ask selection on this way to be done:
You have parameter e.g.  Par3 for that field3. In report as I mentioned you have  other fields with their parameters.
You select other fields based on their parameter values  and you came to the Par3 you select value and for example there is no value-match for that filed it means complete record will not be pulled out,  does not matter that other fields have value.

Lot of times  customer wants and  asks  to pull out that record  out and show empty field in our case  field3 that Par3 was filtering and hit Null or empty string.
I never was sure how to provide it.
Any Idea?
Question by:Taras
  • 3
  • 2
LVL 100

Expert Comment

ID: 39175843
SO if Par3 has 45 as the value to look for what you want is 45 or NULL?

(IsNull({Field3}  OR {?Par3} = {Field3})

LVL 34

Expert Comment

ID: 39176996
Do you want to allow the user to specifically ask for the records where field X is null or an empty string (instead of asking for some other value), or do you want to include those records, no matter what value the user asked for?

 mlmcc's suggestion should give you the second one, although he left out the ")" for the IsNull function:

(IsNull({Field3}) OR {?Par3} = {Field3})

 If you want to allow the user to specifically ask for the null values, you could have a special parameter value for that.  One obvious choice would be "Null", assuming that your field will never be that string.  Then that part of the formula would look something like:

({?Par3} = "Null" and IsNull ({Field3})) or
 {?Par3} = {Field3}

 If you want them to be able to ask for the records where the field is an empty string, they could just enter an empty string in the parameter.  If you want to combine that with the "Null" option, so that it gives you both the null and empty string records, you could use:

({?Par3} = "Null" and (IsNull ({Field3}) or {Field3} = "")) or
 {?Par3} = {Field3}


Author Comment

ID: 39190720
James I am interested in for that first  option you mentioned.

 Let say can we put both option empty string “” and Null value for the field3  as “NoEntry”.
To not confuse user with "" or "Null" , he see that as no entry.

Now when parameter is opened in front of the user he sees next choices e.g. :

If he wants e.g.  A and B   he will pick up A and B and selection will pull only records for A and B no other.
If he wants A and B plus those with empty string or Null values he  will select :  A, B, NoEntry.

How code with Par3 looks for this?
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

LVL 34

Accepted Solution

James0628 earned 500 total points
ID: 39191893
I think it would just be something like this:

({?Par3} = "NoEntry" and (IsNull ({Field3}) or {Field3} = "")) or
 {?Par3} = {Field3}


Author Closing Comment

ID: 39194738
Thanks a lot.
LVL 34

Expert Comment

ID: 39196416
You're welcome.  Glad I could help.


Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

803 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