Solved

Parameter with Value, or Null or empty sting.

Posted on 2013-05-17
6
299 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
Comment Utility
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
Comment Utility
Thanks a lot.
0
 
LVL 34

Expert Comment

by:James0628
Comment Utility
You're welcome.  Glad I could help.

 James
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now