Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

GreenBar in Reports - SSRS

RSS
Modified on Wed, Jan 23, 2013, 4:26 PM by Administrator Categorized as SSRS (SQL Server Reporting Services)

Overview

The term greenbar is taken from tractor-feed paper that was used in computer printers in the 1970s and 1980s. It had bands of green across the width of the page so that three lines of data would be on a white background, alternating with three lines on a green background. This was done to make it easier to read across long lines of data. This article demonstrates how to reproduce this effect in Reporting Services.

Walk-Through

1. Layout your data in a Table control, with group headers and footers as required.

2. For the BackgroundColor property for the cells of interest, specify the following expression.

{copytext|div1}
=Iif((RowNumber("table1")-1) Mod 6 < 3, "#c0ffc0", "White")

Notes
  • If you have no groups for your table then table1 should be the name of your table control. Otherwise, it should be the name of the lowest level group. Note that this string is CASE SENSITIVE.
  • The color #c0ffc0 is a light green. You can change it to suit your preferences.
  • The above code will color the lines in groups of three (three green alternating with three white). If instead you want to alternate each line (one green alternating with one white), use the following code instead.

{copytext|div2}
=Iif((RowNumber("table1")-1) Mod 2 < 1, "#c0ffc0", "White")

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2018, Patrick Jasinski.