Banded Rows in a Table???

2 posts, 0 answers
  1. Joe
    Joe avatar
    4 posts
    Member since:
    Mar 2016

    Posted 31 Mar 2016 Link to this post

    Hello, I am NOT a report writer, but I've been tasked with learning a bit about Report Designer so I can help support our customers. To that end, I've created a new report with a 3x3 table in detailSection1. I don't have any data sources, just the table. I'm trying to figure out how to create banded rows (i.e., every other row has a different background color). This should be easy, and I've followed these steps from the online help, but all they do is make my whole table change color, not every other row.

    Any help would be greatly appreciated! Thanks,



    1. Select the detail section of your report.
    2. Select the ConditionalFormatting property in the Context Menu or the Property Grid. 
    3. Click the New Rule button. 
    4. Enter the expression "= RowNumber()%2"
    5. Select the equal "=" operator from the drop down list.
    6. Enter the value as "=1".
    7. Click the Style button. 
    8. Click the Background style item. 
    9. Enter the color as "#F0F0F0".
    10. Click OK to close each of the open dialogs.
  2. Katia
    Katia avatar
    600 posts

    Posted 04 Apr 2016 Link to this post

    Hi Joe,

    If your table is a static table (does not have any dynamic data) = RowNumber()%2 expression will be executed only once and the result will be 1. Therefore, the color will be applied to the whole table.

    In order the specified rule to work as expected, Detail section must be rendered multiple times (for each record from the data source). However, in your scenario the static row is rendered only once - Understanding Static and Dynamic Rows and Columns.

    Depending on report's layout and data bindings, you can specify the name of the data scope as an argument for the RowNumber function. Note, that you can only specify the current scope or a containing scope, not the scope that is lower or at the same level in containment order than the current scope.

    You can find attached a sample implementation of alternating row style working with a test data from AdventureWorks database. In this example, conditional formatting rule is applied to the table's inner textboxes.

    We hope this will help.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top