I'm aware that if I want to know the current page number of a report, I have to use the built-in variable PAGE_NUMBER and set the evaluation time property to 'Now', while if I want to get the total number of pages of the report, I have to use the same built-in variable PAGE_NUMBER, but set the evaluation time property to 'Report'.
So far, so good.
However, I need the value of the total report pages in a custom variable, so that I can use it, for example, in a "print with condition" property, in order to decide to print or not an header, depending on that value.
How can I do that ? The evaluation time property is not available for a custom variable; is there a tricky way to circumnavigate this problem ?
How would you store the total number of pages of a report in a custom variable ?
subject: Jasper report - How could I store the total number of pages of a report in a custom variable ?