ReportViewer: Alternating color on rows

According to MSDN you do the following:

Creating a Green-Bar Report To apply a green-bar effect (alternating colors every other row) to a table in a report, use the following expression in the BackgroundColor property of each text box in the detail row:

=iif(RowNumber(Nothing) Mod 2, "PaleGreen", "White")

To alternate colors by row groupings:

=iif(RunningValue({Expression Being Grouped On}, CountDistinct, nothing) Mod 2, "WhiteSmoke", "White")

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s