This is a migrated thread and some comments may be shown as answers.

Banded Rows in a Table???

1 Answer 213 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 31 Mar 2016, 04:28 PM

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,

-Joe

 

http://docs.telerik.com/reporting/faq-alternating-style#display-reports-with-alternating-style-rows

  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.

1 Answer, 1 is accepted

Sort by
1
Katia
Telerik team
answered on 04 Apr 2016, 04:21 PM
Hi Joe,

If your table is a static table (does not have any dynamic data) = RowNumber()%2 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, formatting rule is applied to the table's inner textboxes.

We hope this will help.


Regards,
Katia
Telerik
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
Tags
Report Designer (standalone)
Asked by
Joe
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or