Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

5.02 Tutorial 5-1. Creating Green Bar Reports

Turtorial 5-1. Creating “Green Bar” Reports

Let’s create a “Green Bar” report that simulates the paper style that was used to be common in business reports printed on wide paper. Every other line was shaded in a light green color. This made it easy for the reader to scan across a long line of data and not lose track of which row they were reading. We’ll use conditional formatting to simulate the green bar paper.

  1. Open the Crystal Reports sample report, Group By Intervals.rpt. Save it as Green Bar.rpt.
  2. This report has many rows within each group and the readability could be improved by shading every other row.


  1. In design mode, right-click on the gray area to the left of the Details section and select Section Expert from the pop-up menu. This opens the Section Expert dialog box.
  2. On the right side of the dialog box, click on the Color tab.


  1. The color tab only lets you choose the background color. You can either click on the checkbox and select a background color or click on the Formula button to apply conditional formatting. We want the background color to change dynamically, so click on the Formula button.

The Formula Workshop dialog box opens with the cursor in the text editing area. We want the formula to assign crSilver to the background color of every even row on the report.

  1. Type in the following formula:
If (RecordNumber Mod 2 = 0) Then crSilver Else DefaultAttribute;

The calculation divides the current row number by two and gets the remainder. If the remainder is zero, then the current row number is an even number and crSilver is assigned to its background color. If the remainder is not zero, then this is an odd row and we assign the DefaultAttribute to the background color (this is the same as telling it not to modify the original color).

  1. Click the Save and Close button in the top left corner to save the changes.
  2. Click the OK button of the Section Expert to save your changes.
  3. Preview the report and you’ll see that every other row now has silver shading.


This tutorial showed you how to use the Formula Workshop to create a conditional formatting formula. You’ll learn the details of using the Formula Workshop in the next section.