Total pages - OMR marks


Hi to All, 

there is a way to print page numbers on every page and that is all OK, BUT this is not usable when you have to make a report with specific marks on the pages. 

The problem is in evaluation time - PAGE_NUMBER with Evaluation time Now or Page gives the number of the current page, and the PAGE_NUMBER with Evaluation time set to Report gives the correct biggest number of pages of the report. However, that is not usable for generating OMR marks or any other similar purpose that needs printing specific thing on a specific page. 
I have tried with generating counters, and many solutions with sistem variables, mathematics, but with no success. 

Title page has "Benchmark" flag - beggining of the printed document - it is printed as separate page, and that is OK.

Second page printed is the firs page of the subreport (it has to have BOC mark on it - beggining of collation). 

Pages between second and the last page must not contain any marks. 

Last page has to have EOC (End Of Collation) mark printed. The problem is that the mark can't be printed in the Footer area of the page. 
If I try with generating marks in the Footer area of the page, the problem is the exact position of the markers, since Page Footer isn't rendered allways the same way. 

If TOTAL_PAGES or similar variable would show how many pages in the report are, solution would be simple with TOTAL_PAGES - PAGE_NUMBER (if the difference is 0, the mark should be printed) - WITH SAME Evaluation time.

Will this error be ever corrected? 

rmcrni's picture
Joined: Nov 25 2019 - 4:32am
Last seen: 1 month 3 weeks ago

1 Answer:


There are newly (not sure what JasperVersion.. something bigger that 6.x I guess) introduced variables for much easier usage of PageNumbering with SubReports and so on

Just take a look into the built-in variables MASTER_CURRENT_PAGE  and MASTER_TOTAL_PAGES.

BTW: Also you could use the "LastPageFooter-Band" as well to explicitly set your EOC flag differently without any complicated expression

hth + regards


C-Box's picture
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 month 1 week ago