September 4, 2014

SSRS Alternate Row Color

This post will help to set alternate row background color in SSRS tablix report using an expression.

1) Select the row from tablix then go to properties (Press F4) and then go to expression of background color property.

2) Use this expression:
                                    = IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")

Then, click OK.

Here, RowNumber(Nothing) will work in each row to give row number in sequential order.

(RowNumber(Nothing) Mod 2 means RowNumber(Nothing) will be divided by 0 and it should give remainder as 0 or 1. Then, if condition is used to give the color for its corresponding result.

3) Then, run the report to see the output. You should get something like this.

Hope, this will help you.