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
Solved

SSRS Expression how to check for a NULL value

Posted on 2013-05-14
7
1,528 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 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