I managed to reproduce the problem only when using the expression PageNumber = PageCount
to hide the PageFooter on the last page.
This is a corner case that is due to a known limitation in the paging logic.
Let me explain:
The resulting page count depends on the visibility of the page footer section as this changes the available space for the rest of the report content. In the same time, we setup the visibility of the page section to depend on the page count. This leads to uncertainty. This situation has no solution.
Here is an attempt to explain this in more details:
To know the PageCount
that will be generated, the Reporting Engine needs to count the pages first. By default the PageFooter
is available only on the first page, and on a page which is initially not known, since PageNumber = PageCount
cannot be evaluated (PageCount
is not known). When the engine reaches the page that will be the last, it is not aware that it has reached the last page, hence assumes it will have NO PageFooter
(by default it is NOT Visible
), and calculates that the final content of the report will fit on this page (without PageFooter
). Thus, the engine evaluates that the current page will be the last one. At this point the PageCount
is set to the current PageNumber
When the real rendering starts, everything goes correctly until the last page is reached. However, now PageCount
is known and the engine has to put a PageFooter
on it. Due to the big PageFooter
, the entire content does NOT fit on a single page, hence part of the content needs to be moved to another (extra) page. This extra page will have PageNumber = (PageCount + 1)
, as observed.
Note that this is a limitation of the processing algorithm, not a bug. With a PageFooter
that is too big to fit together with the normal page content on a single page, part of the (detail) page content should be moved to another page. There is no point to move only the PageFooter to another page as PageFooter is meaningless without page content. In this case the PageFooter will actually be on the page preceding the last one.
The workaround is to set the PageFooter
as Visible only on the first page, and use a ReportFooter
that will be displayed by default only on the last page.
If the number of pages is known you can alternatively hard code this value instead of PageCount
, i.e. use PageNumber = PreviouslyKnownPageCount
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?
Telerik Feedback Portal
and vote to affect the priority of the items