Monday 1 December 2014

SSRS Report: Alternate color for rows in ssrs



Set an Alternate Row Color in SSRS


In Short, expression for alternate color:
=IIF(RowNumber(Nothing) MOD 2,”LightGrey”, “LightBlue”)

Alternate Color for Group By cell
If you set alternate color for Group By cell, then the alternate color break down to the following rows. What it means is that, it does seems, alternate color is working properly. So the best option is

  1. Remove the alternate for Group By cell
    1. Select the Group By cell
    2. Set the Background color property to: No color
  2. Repeat the steps 1 for all Group By list.


Set an Alternate Row Color in SSRS
In this article, I will show you how to set an alternate row color in Tablix in Report.
1. First of all Open any SSRS report which contains Tablix.
2. Now select Details Row from Tablix.
2-Set an Alternate Row Color in SSRS
3. Then press F4 key or manually open property window. In property window select BackgroundColor Property. Then click on arrow button which is on right side and select Expression as shown in below screenshot.
3-Set an Alternate Row Color in SSRS
4. An Expression window opens. In that window paste following expression. Then click on OK button.
=IIF(RowNumber(Nothing) MOD 2,”LightGrey”, “LightBlue”)
4-Set an Alternate Row Color in SSRS
You can change color as par your requirement. Simply replace color used in above expression.
5. Now run your report. You will see results look like following screen shot:
5-Set an Alternate Row Color in SSRS
6. Similarly if you want to change row background color in specific condition like you need to change row background color when Address contains Ct. In that situation use following expression.
=IIF(InStr(Fields!Address.Value,”Ct”)=0,”LightGrey”,”LightBlue”)
Now run your report. You will see output like following screen shot:
6-Set an Alternate Row Color in SSRS
Congratulations! We successfully Set an Alternate Row Color in SSRS Report.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home