Row color and Alternate Row color for Table in RDLC Report Row color and Alternate Row color for Table in RDLC Report asp.net asp.net

Row color and Alternate Row color for Table in RDLC Report


Very easy! :-)

In your report designer surface, you need to select the data row that contains your data - something like this:

enter image description here

When you look at the Properties box for that data row, you will see a property call BackgroundColor - open the dropdown, and you'll see all the usual colors - but also a menu item at the bottom called Expression...:

enter image description here

When you select that item, a dialog box will open that allows you to insert an expression to determine the background color for that row - that's where you need to put that expression that you have - and that's all there is!


If you don't want to add a RowNumber field to your dataset, just use the built in function RowNumber(ScopeName as String). I commonly use the name of the DataSet as parameter:

= IIF(RowNumber("CarsWithNoMakeDataSet") Mod 2 = 0, "LightGrey", "Transparent")

You can find this function at the Expression dialog, Category "Common Functions", Subcategory "Miscellaneous"

As the ScopeName parameter it is possible to use the name of a Group or Data Region. Please find more here.

Hope it helps,


The expression definition to alternate the row color is:

=iif(Fields!RowNumber.Value Mod 2 = 0,"LightGrey","White")

This sample assumes you have a field RowNumber in your dataset.