Adding Alternate Row Colors in SQL Server Reporting Services (SSRS)
To set different color (two different colors) to alternate rows, follow these steps:
- Select the Data Row of the table in the report.
- Go to Properties Window.
- Under the BackgroundColor property, select expression from the drop down.
- Enter the expression “=IIf(RowNumber(Nothing) Mod 2 = 0, “Color1”, “Color2”)” in the Expression Window.
- In the above expression replace Color1 & Color2 with either the Color Code/Color Name as appropriate.
Below is a snapshot of a sample SSRS report with two different colors for alternate rows.
This customization is very useful in case of long running reports with hundreds/thousands of records having many columns where in tracking the data in one single row across all the fields becomes a little difficult/confusing if we don’t use separate colors for alternate rows.