I have embedded TOC in my report as described in the Jasper Report.
It works well within the limitations mentioned in the example:
This operation, apparently, has only one inconvenience. The final document does not reflect the modification in page order. You can see that in our example the table of contents does not display the page number on the footer and that page number 1 appears after the table of contents.
To get around this limitation I only need one: a variable (or something else) that tells me how many pages TOC has.
When accepting a single-page TOC, I can simply add 1 to the current and total page numbers in the footer of my document. Then my 20-page PDF will have the following pages:
- TOC (without page footer)
- 2/20
- 3/20
- ...
- 19/20
- 20/20
In addition, I will need to add one for each heading in the Subheading Heading to correct page numbers. But since my TOC may be longer than one page, this is not an optimal solution.
Is there any way to do this?
jasper-reports
arturh
source share