Solved

SSRS Expression how to check for a NULL value

Posted on 2013-05-14
7
1,468 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

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

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…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

13 Experts available now in Live!

Get 1:1 Help Now