Some Important SSRS 2008 Expressions



a.       To Display execution time out of report, you can use: ="Report Executed On: " & Globals!ExecutionTime
b.      To Display Page on report, you can use: = "Page(s) " & Globals!PageNumber & " of " & Globals!TotalPages
c.       Decision Function =IIF(Fields!Rate.Value > 10, True, False), it checks the value if Rate value is greater than zero then it returns true otherwise false
d.      Multiple if condition=IIF(Fields!myValue.Value>=10, "Blue", IIF(Fields! myValue.Value >= 20, "Green", "Red")) , it checks the first whether myvalue is greater than or equal to 10 then it set’s the colour Blue, if it is greater than or equal to 20 then it sets Green otherwise Red
e.      The below expression checks the ExpiryDate field of an item and return "Red" if it is more than 30 days old, and "Blue" otherwise: =IIF (DateDiff ("d",Fields! ExpiryDate.Value, Now())>30,"Red","Blue")
f.        Here is the simple example of SWITCH expression, =Switch(Fields!Quantity.Value<=100,"Red",Fields!Quantity.Value>=200, "Blue", Fields! Quantity.Value > 400, "Yellow")
I hope you will enjoy the topic.
Cheers.

Comments