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
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.
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.
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.