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

Banded report by group?

1 Answer 196 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 02 Jan 2021, 07:48 PM
I have a report that I put together that has a cross tab table grouped on TitleUnitEmail address, and TitleNumber.  I'm trying to get a conditional format applied that will alternate the cell color by theTitleNumber group but I can't get it it work right.  For a regular table I know I can add = RowNumber()%2 and set the value to =1 and it works great but I can't figure out how to achieve the same result when I want the band to occur based on the TitleNumber group and not the Row Number.  Help?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 06 Jan 2021, 12:37 PM

Hello Tyler,

The scope that is specified in the RowNumber(scope) data function should be in quotation marks or apostrophes. For example, the Expression should look like this:

=RowNumber('titleNumber')%2

Note that the titleNumber above is the name of the corresponding crosstab2 row group as seen from the screenshots.

However, the above may not display all the rows of a group in the same color, alternating among groups. The reason is that the row numbers will be counted within the group, hence will increase within the group.

I suggest the following expression instead:

=RunningValue("crosstab1", CountDistinct(Fields.group))%2

The CountDistinct aggregate function counts the distinct group values that would remain 1 for the first group, 2 for the second, and so on. The RunningValue data function assures that only the values up to the current one get respected.

I have attached a sample report for reference.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Report Designer (standalone)
Asked by
Matt
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or