This blog has been moved to http://dattatreysindol.blogspot.com.

Please visit http://dattatreysindol.blogspot.com for all updates from now on.


Thanks for visiting my blog.



- Datta




| 0 comments ]

SQL Reporting Services (SSRS) is a great tool offering lots of features and ability to customize the report appearance apart from addressing complex business reporting needs. Above all SSRS is one of the components which comes free when you buy SQL Server :-)

Often in Reporting and Dashboarding projects customization/look and feel becomes one of the important aspects of the project. SQL Server Reporting Services offers various options to customize the look and feel of the report to make the report more Jazzy and Visually Appealing.

One of the most powerful components of SSRS is the ability to control various elements/properties of a report with the use of expressions. One of the properties which is usually set in tabular reports especially in case of really long reports with hundreds or thousands of rows is to set different colors to alternate rows.

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 accross all the fields becomes a little difficult/confusing if we dont use seperate colors for alternate rows.