Saturday, February 23, 2013

Switch/Select Case Statement in Reporting Services

This is how you do a  Switch or Select Case statement in Reporting Services.  This would go in the Expression field of a field.    Note that the 'Else' condition is implemented by using the 'True' item as the last line in the statement.

 = switch (  
      Fields!Problems.Value = 1, "Units cannot be converted.",  
      Fields!Problems.Value = 2, "Price is zero.",  
      Fields!Problems.Value = 4, "Quantity is zero.",  
      True, Fields!Problems.Value  
 )