miguelangel.marina Posted December 18, 2013 Share Posted December 18, 2013 Hi,The most of the Reports of my application have a common page footer. Therefore, I'm trying to generate a subreport that contains this content to be embedded in all reports.However, this common footer contains the pagination of the Report with the following format: Page X of Y where Y is the total number of pages of the Report.I have defined this subreport passing the pagination as parameter from the master Report, but I have not been able to display the total number of pages.I think that the problem is that when the total number of pages is evaluated in the master Report to be passed as parameter to the subreport, the master Report is not able to determine how many pages will have the report yet.I have already read some posts about this problem and it seems that is not possible to solve it, but I would like to know if someone has found a solutionThanksMiguel Angel Marina Link to comment Share on other sites More sharing options...
misterfoo47 Posted December 18, 2013 Share Posted December 18, 2013 Hi,I have the same problem.Regards Link to comment Share on other sites More sharing options...
Ankur Gupta Posted December 18, 2013 Share Posted December 18, 2013 Hi,As you would have noticed that in the template Page X of Y - 'Page X of' has an evaluation time of NOW where as 'Y ' has an evaluation time of 'Report'. This trigers the time when they are evaluated, in your case you are passing this value as parameter in the subreport and that is placed in the Page Footer, this will pass the current page number instead of the total count. This happens because the page footeris encountered at the end of every single page which demands the value of the Total Page, but total is failed to be generated as its evaluation time is Report so it passes the current page number of the master report.Now another thing is that if you want to use scriptlets to determine the total page number that is also not possible beacause when the scriptlet events are fired, the JasperPrint onject which is created at the runtime of the JRXML is not yet final, so we can still not get the total number of pages.So as far as I know, we cannot obtain the total number of pages of the report and pass it to any other subreport or element for manipulation.Though, a workaround in you case can be -You can place the page number portion in the main report and keep the rest in the subreport. Hope that helps. Thanks,Ankur Link to comment Share on other sites More sharing options...
miguelangel.marina Posted December 18, 2013 Author Share Posted December 18, 2013 Hi,Thanks for your response.Yes, I had already thought to place the page number portion in the main report, but I wanted to confirm that there does not exist a workaround to place all content in the subreport.Thanks, Miguel Angel Marina Link to comment Share on other sites More sharing options...
jummy-qa Posted May 2 Share Posted May 2 hey, did you find any solution for it? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now