Solved

SSRS Expression how to check for a NULL value

Posted on 2013-05-14
7
1,488 Views
Last Modified: 2013-06-19
I have an SSRS report where a textbox on the report either shows or hides data based on wheather a checkbox is checked on an application. The issue that I have is that the expression is not showing the textbox when the checkbox has been checked.
My expression is below:
=IIF(IsNothing(Fields!gtri_maintenanceid.Value), First(Fields!gtri_maintenanceid.Value) & vbCrLf & First(Fields!ServiceSupportRepPhone.Value)  & vbCrLf & First(Fields!ServiceSupportRepEmail.Value),"")

gtri_maintenanceid is the field on the application that determines if the textbox on the report is displayed or not. The maintenance id is a lookup value that if not null on the application is converted to a boolean value reflecting that it is or is not checked.
0
Comment
Question by:newjeep19
  • 4
  • 2
7 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 39165589
Try this..

=IIF(Trim(Fields!gtri_maintenanceid.Value)=""), Fields!gtri_maintenanceid.Value & vbCrLf & Fields!ServiceSupportRepPhone.Value  & vbCrLf & Fields!ServiceSupportRepEmail.Value,"")

I would not use First. This will only return the first record in that field.
0
 

Author Comment

by:newjeep19
ID: 39165666
Thank you for the response, however, the textbox is still not visable.
0
 
LVL 27

Expert Comment

by:planocz
ID: 39165729
Have you verified that your dataset is producing the correct answer to the report?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:newjeep19
ID: 39165765
yes
0
 
LVL 27

Expert Comment

by:planocz
ID: 39166139
You will have to piece together your expression to test it.
first have all the textboxes un-hide so you can see what is coming to the report.
then add the other piecses as you get the right answer.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39167139
In addition to what planocz mentioned: add a couple of additional columns to your tablix for testing purposes.  Here's what to put in them:

First new col: =Fields!gtri_maintenanceid.Value
Second: =Len(Fields!gtri_maintenanceid.Value)

You can use the Len function Instead of using IsNothing, though IsNothing should normally work as well.  With Len, your expression would be something like =IIF(Len(Fields!gtri_maintenanceid.Value) = 0, <no maintenance ID>, <maintenance ID exists>)

(replace <...> placeholders with valid expression)

Also, your expression doesn't make a lot of sense.  Basically (and simplified) it says to display the maintenance ID when there is none.  Shouldn't it be the other way around?
0
 
LVL 27

Accepted Solution

by:
planocz earned 500 total points
ID: 39168963
Your right ValentinoV I missed that.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to read BOM (Byte Order Mark) from csv file. 4 38
Problem to error 4 47
designing in object programming 12 52
C# Comparing String Arrays. 5 28
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

25 Experts available now in Live!

Get 1:1 Help Now