I am facing a very strange issue with a jasperreport (attached). The report contains a subreport which is the table of contents. We populate the table of contents by binding a method to a scriptlet.
Now the issue is that when the addHeading() method bound to the scriptlet is called the page number variable has an incorrect value. (Based on my understanding this is the variable before incrementing)
1. To investigate I bound another variable with the pageheader section. I see that the page Header binding is actually called after the addHeading().
2. This has led me to believe that Jasper first tries to print and if the content overflows only then adds a new page and re-renders the content in the band.
Can anyone please put some light on this, I have been struggling with this for two days now . Maybe I need to change the report design..but not sure..