newjeep19
asked on
SSRS Expression how to check for a NULL value
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 _maintenan ceid.Value ), First(Fields!gtri_maintena nceid.Valu e) & vbCrLf & First(Fields!ServiceSuppor tRepPhone. Value) & vbCrLf & First(Fields!ServiceSuppor tRepEmail. 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.
My expression is below:
=IIF(IsNothing(Fields!gtri
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.
ASKER
Thank you for the response, however, the textbox is still not visable.
Have you verified that your dataset is producing the correct answer to the report?
ASKER
yes
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.
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.
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_maintenan ceid.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_maint enanceid.V alue) = 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?
First new col: =Fields!gtri_maintenanceid
Second: =Len(Fields!gtri_maintenan
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_maint
(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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
=IIF(Trim(Fields!gtri_main
I would not use First. This will only return the first record in that field.