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

Conditional formatting of a table using RowNumber()

3 Answers 1885 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christophe
Top achievements
Rank 1
Christophe asked on 05 Sep 2013, 03:34 PM
I would like to have every second row with a different style in my table.
I have created the following conditional formatting rules for the two different styles:

Expression: =RowNumber() % 2
Operator: =
Value: 1

Expression: =RowNumber() % 2
Operator: =
Value: 0

The issue is that the values are grouped by the field of the first column, and the RowNumber() function restarts to 1 for each new country value (see the attached screenshot).

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 06 Sep 2013, 03:23 PM
Hi Christophe,

The RowNumber() function can take a scope as argument, so if you want to count the number of rows over the whole crosstab, you should use the following expression in the conditional formatting:

=RowNumber("crosstab_name") % 2

where crosstab_name is the name of the current crosstab.

Otherwise when using just RowNumber() you are counting the number of rows in the current data-context (defined by the crosstab groupings).

Regards,
Nasko
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Rory
Top achievements
Rank 1
answered on 05 Aug 2019, 08:24 PM

An how exactly do we figure out the "crosstab_name"? I'm not seeing that anywhere. 

 

I've created a table with multiple rows in the template and the rownumber() is always 1.

0
Rory
Top achievements
Rank 1
answered on 05 Aug 2019, 08:31 PM

Nevermind, I got it working, by passing the Telerik.Reporting.Table's name so in my case I used 

= RowNumber("table2")%2 

for the Expression

Tags
General Discussions
Asked by
Christophe
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Rory
Top achievements
Rank 1
Share this question
or