Solved

Parameter with Value, or Null or empty sting.

Posted on 2013-05-17
6
311 Views
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?
0
Comment
Question by:Taras
  • 3
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
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})

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
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}
)


 James
0
 

Author Comment

by:Taras
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. :
A
B
C
D
NoEntry.

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?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 34

Accepted Solution

by:
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}
)


 James
0
 

Author Closing Comment

by:Taras
ID: 39194738
Thanks a lot.
0
 
LVL 34

Expert Comment

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

 James
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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