Conditional formatting for the last row on the page

3 Answers 85 Views
Conditional Formatting Report Designer (standalone) Styling
fsfsd
Top achievements
Rank 1
fsfsd asked on 06 Oct 2021, 12:20 AM
Good afternoon.
I'm trying to do conditional formatting for the last row in table on a page, but I can't figure out when a page break occurs. Is it possible to do this?

I can calculate the last row in the group and add conditional formatting like this:

= Exec ('groupID', Count (Fields.No)) = = RowNumber ()

But I do not know how to find out that the row is the last when moving to a new page.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Oct 2021, 02:23 PM

Hello,

If I understood correctly, you have a table and some table group where you are setting a PageBreak, is that correct?

And the goal is to apply some specific styling to the last row before the page break is inserted, correct?

If that is the case, you need to use a statement like the following for your conditional formatting rule:

= RowNumber("group1") = = Exec("group1",Count(Fields.value))

Both the Count and RowNumber functions should be executed in the same scope to ensure that the values are correct.

I have attached a sample report demonstrating this approach and an image of the rule, please check them out and let me know if you have any other questions or need further assistance.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
0
Oleg
Top achievements
Rank 1
Iron
answered on 11 Oct 2021, 12:29 AM | edited on 11 Oct 2021, 12:30 AM

No, you misunderstood. If you look at my screenshot (attached again), which I attached to the ticket, you will see that when the group ends, the style has already been applied to the last line, this works with my formula, in principle it is no different from yours, because calculations are already taking place in one table.
In addition to the page break between groups, I have a page break that occurs when a group does not fit on one page, at which point I need to apply the style.

 

0
Dimitar
Telerik team
answered on 11 Oct 2021, 01:43 PM

Hello Oleg,

My apologies for misunderstanding the problem.

Based on the image, the real problem is that the table does not have a border on the last row before the page break gets inserted, is that correct?

Possible workarounds are to add a static group and to set the GroupFooterSection's top border. The section is printed right after the Detail section ends. The GroupFooterSection.PrintOnEveryPage can be set to true, also you can place a Shape item in the section if you prefer to use it as a "border" instead of using the whole section's borders.

The attached demo report illustrates the suggested settings, please check it out and let me know if you have any other questions.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Oleg
Top achievements
Rank 1
Iron
commented on 11 Oct 2021, 10:43 PM

A workaround is not suitable as a solution :(, because a static group has a fixed height, in my case, the height of the rows is always different (see screenshots), which causes the page break in an unknown place for me.

Maybe there is another solution of problem?

Dimitar
Telerik team
commented on 12 Oct 2021, 10:56 AM

Thank you for the provided screenshots.

Based on the screenshots, I imagine the problem is that since the height of the rows is different, the white space between the table and the bottom of the page may vary, and thus you are afraid that the border may not be at the right place, is that correct?

I understand your concern but unfortunately, there are no other workarounds available at the moment. I would recommend you to make a feature request about such functionality on our feedback portal - Progress® Telerik® Reporting Feedback Portal.

Other than that, you could try to set the table group's TableGroup.GroupKeepTogether Property to true which would force the engine to try and keep all rows or columns that belong to the current group on one page, then you could use the approach from the first reply, with the RowNumber function, to catch the last row of the group which should be the last row on the page. However, this may not work when the groups are too big and can't be kept on one page no matter what.

 

Oleg
Top achievements
Rank 1
Iron
commented on 12 Oct 2021, 11:10 PM

Yes, you are right, the groups are very large and in most cases take more than 10 pages ... I'll try to create a request to add functionality. Thanks.
Tags
Conditional Formatting Report Designer (standalone) Styling
Asked by
fsfsd
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Oleg
Top achievements
Rank 1
Iron
Share this question
or