Solved

SSRS Expression how to check for a NULL value

Posted on 2013-05-14
7
1,595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

635 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