How can I create a "Greenbar" style report in SQL Server Reporting Services like the one shown below?
We can simulate a greenbar styled report in SQL Server Reporting Services (SSRS) by alternating the BackgroundColor property for even and odd rows. For those of you not familiar with greenbar reports, these reports are printed on paper with horizontal boxes alternating between green and white to help the reader keep their eye on one line as they read from left to right.
Speaking from personal experience, if the reader of the report will only view the report online and not print the report, then alternating between green and white backgrounds will be very helpful. However, if the report is to be printed then two issues might arise. The first issue is cost since green ink is typically more expensive than black ink. The second issue is legibility when the printer only has a black ink or toner cartridge. Therefore, in this tip we will alternate between white and a light shade of gray.
In design mode, select the cells that make up the report data details row.
In the Properties window, press on the down arrow in the BackgroundColor property's value box and click on Expression...
The Expression builder window now appears. Enter the following expression:
=iif(RowNumber(Nothing) Mod 2,"Gainsboro","White")
Click on OK and preview your report.
Print out one page of the report on the report user's printer to make sure it is legible. The color chosen might need to be lighter or darker, depending on the printer.
Also, check out more tips and tutorials on SSRS MSSQLTips.com.
- SQL Server Reporting Services Tutorial
- SQL Server Reporting Services (SSRS) Repeating Headers On Pages
- SQL Server Reporting Services (SSRS) Controlling Report Page Breaks
- Add a linear trendline to a graph in SQL Server Reporting Services
Last Update: 2015-03-31
About the author
View all my tips