Friday, 9 June 2017

SSRS - Switch Statement

Problem: Display month (1,2,3 to January, February and March)

Right click on the expression, it will open popup and paste the below expression there.
In below expression, MonthNumber is the column name, if column value is 1 then change to January and so on with the help of switch statement.

=switch(
Fields!MonthNumber.Value=1,"January",
Fields!MonthNumber.Value=2,"February",
Fields!MonthNumber.Value=3,"March",
Fields!MonthNumber.Value=4,"April",
Fields!MonthNumber.Value=5,"May",
Fields!MonthNumber.Value=6,"June",
Fields!MonthNumber.Value=7,"July",
Fields!MonthNumber.Value=8,"August",
Fields!MonthNumber.Value=9,"September",
Fields!MonthNumber.Value=10,"October",
Fields!MonthNumber.Value=11,"November",
Fields!MonthNumber.Value=12,"December"
)



Enum with Flag Attribute in .NET

In .NET, you can use the Flags attribute with an enum. You can combine multiple values into one to represent a set of bit fields. It is use...