Empty or Null value display in SSRS text boxes

keithwarren7 picture keithwarren7 · Aug 9, 2010 · Viewed 137.4k times · Source

Using SSRS (2008) what is the best way you have found to handle null or empty values and replace them with something else to display. The quite obvious solutions is

=IIF(IsNothing(Fields!MyField.Value),"NA",Fields!MyFields.Value)

That works though it is tedious, my hope was to find something like an EmptyText property on the textbox but alas nothing. Any ideas? Should I make a custom report item from the TextBox base that creates this property?

Answer

rajsekar picture rajsekar · Dec 31, 2015
=IIF(ISNOTHING(CStr(Fields!MyFields.Value)) or CStr(Fields!MyFields.Value) = "","-",CStr(Fields!MyFields.Value))

Use this expression you may get the answer.

Here CStr is an default function for handling String datatypes.