O'Reilly logo

SQL Server 2012 Reporting Services Blueprints by Mickey Stuewe, Marlon Ribunal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Alternating row colors

You've probably seen tables with alternating row colors in some applications. The alternating row colors are normally added for readability purposes. You would notice that wide tables with multiple columns are easier to read when the colors of their rows are alternate.

Let's make the row color alternate between two colors: silver and yellow.

  1. Select the whole detail row and, on the Properties window, look for the BackgroundColor property and set it to an expression (from the drop-down list select Expression).
  2. Add this expression:
    =IIF(RowNumber(Nothing) Mod 2 = 0, "Silver", "Yellow")
    

Note

In previous example, the IIF function is a decision function that returns a Boolean Value (True or False) depending on the criteria (whether ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required