Crystal Reports XI – Alternate Row Color

Alternate Row Color in the Detail Section of your report

  1. Right click the “Details” section and select “Section Expert”
  2. Select the “Color” tab
  3. Select the “X-2″ button (formula button)
  4. Type the following:
    if RecordNumber mod 2 = 0 then crSilver else crNoColor
  5. Save and close

The row colors of your detail section will now alternate between Silver and NoColor.

NOTE:  If you want to alternate the row color based on the entire group instead, use “GroupNumber” in place of “RecordNumber” in the formula, such as:
if GroupNumber mod 2 = 0 then crSilver else crNoColor

Here are some other options for the “color”:
Color (red, green, blue)
crBlack
crMaroon
crGreen
crOlive
crNavy
crPurple
crTeal
crSilver
crRed
crLime
crYellow
crBlue
crFuchsia
crAqua
crWhite
crNoColor

Comments are closed.