sunianu Posted November 7, 2008 Share Posted November 7, 2008 Hello....I have one master report with 40 subreports . I placed page number in the Page footer section of master report. All sub reports are displaying correctly with page numbers. How can I get page number of each subreport in the main report ? or how can I get on which page the subrport s displayed ? ThanksSuni Link to comment Share on other sites More sharing options...
C-Box Posted November 7, 2008 Share Posted November 7, 2008 Just pass the $V{PAGE_NUMBER} from Master to SubReport to get to know the current PageNumber from Master in SubReport.The other direction would be a SubReport Return Variable, where you can return the SubReports LastPageNumber back to MasterReport. just try a biththC-Box Link to comment Share on other sites More sharing options...
sunianu Posted November 10, 2008 Author Share Posted November 10, 2008 Hello,Thanks for you replyI passed $V{PAGE_NUMBER} from master to subreport but the number displayed on the subreport was 1(master reports page no) instead of 3.Also how can I get the last page number of a subreport ThanksSuni Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 12, 2008 Share Posted November 12, 2008 Hi,Do you mean you want to know when inside the subreport, how many pages will be in the master?In case you do, then it is not possible. Only the master report can display the total number of pages in the master report.Thanks,Teodor Link to comment Share on other sites More sharing options...
C-Box Posted November 12, 2008 Share Posted November 12, 2008 Hmm, if I understand right, you want to show the amount of pages the SubReport has.So if you want to show the TotalPageNumber (or LastPageNumber) of a SubReport you have to use a ReturnVariable that is returned from SubReport back to MasterReport where it can be shown.See the SubReport-Sample how to use ReturnVariables and what attributes has to be set in MasterReport to show the ReturnVariable. hthC-Box Link to comment Share on other sites More sharing options...
kolja.ehlersiconplc.com Posted November 12, 2008 Share Posted November 12, 2008 I am trying to do a related thing. In my subreport the $V{PAGE_NUMBER} Variable when Evaluation time is set to "Report" it outputs the total Pages of the subreport.Is it possible to pass this Variable to the Master Report? I have tryed by doing:<returnValue subreportVariable="PAGE_NUMBER" toVariable="Pages"/>But If I output $V{Pages} in the Master it output only null. Is this not possible?ThanksPost Edited by Kolja Ehlers at 11/12/08 11:21 Link to comment Share on other sites More sharing options...
C-Box Posted November 12, 2008 Share Posted November 12, 2008 Have you set the SubReportVariable (eg. $V{"SubRepTotalPages}") to the MasterReportVariable (eg. $V{RetVar_SubRepTotalPages}) in the SubReport Return Variables Properties ??? (like shown in SubReport Sample provided with JasperReports Full Download package) Be aware not to reset the MasterVariable (eg. $V{RetVar_SubRepTotalPages}) and to set the EvaluationTime to "Report" instead of Now. Must work (done something similiar some month ago for a customer of us) C-Box Link to comment Share on other sites More sharing options...
ahmed.shaker Posted April 12, 2017 Share Posted April 12, 2017 Hello there , sorry for asking my question here .. but i think it's related to the same topic .i have a sub-report that that will be used as a generic footer in all of my reports. how i can display the page number of each report inside this footer.for example . i have sub-report called footer that contains the page number . and i have a report called Myreport.now i will drag this subreport inside MyReport. and i expected to see number of total pages displayed at footer (page 1 of 5 ) for example.any support will be highly appreciated.Thanks in advance. 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