Monday, April 6, 2009

SSRS check for blank parameters

Within an SSRS .rdl file you may want to check to see if a Parameter is null before you try to filter results, below are a couple solutions:

=IIf((LEN(Parameters!range.Value)>0), Parameters!range.Value, Fields!range.Value)

=IIf(IsNothing(Parameters!range.Value), Fields!range.Value, Parameters!range.Value)

Sunday, April 5, 2009

DataBinder if else solution

Below is an example that will allow two different images to be displayed in an image control based on the DataBinder.Eval result.

<img src="<%# (Convert.ToInt32(DataBinder.Eval(Container.DataItem, "availabilityId")) == 1) ? "/images/available.gif" : "/images/scheduled.gif"%>" alt="schedule" id="scheduleImg" style="border:none"/>