medopal Posted April 6, 2008 Share Posted April 6, 2008 hi all, thank u or this nice forum. my question is, how to use page_number and page_count variables to make an expression like this: (Page 1 of 5), where the 1 is the current page and the 5 is total. i know it seems easy, but when the report contains, 5 or 6 sub-reports and a few crosstabs (that can split into pages), the page count gives always the wrong result, i think because its calculated after all the sub-reports are filled!!, but the problem is some of the sub-reports will be filled in the 5th page, and i want the total number of pages to appear on the footer of all the previous pages BTW, i tried to postpone the evaluation time of the page_count text field and still wrong, it keeps giving 1 (and sometimes 0) thx in advance Link to comment Share on other sites More sharing options...
medopal Posted April 7, 2008 Author Share Posted April 7, 2008 60 passed by and no comments!!! Link to comment Share on other sites More sharing options...
christiaan_se Posted April 7, 2008 Share Posted April 7, 2008 Hi,you have to use two separate textfields (instead of one) using the same variable PAGE_NUMBER, but setting different evaluation time current page: JRExpression.EVALUATION_TIME_NOWtotal page count: JRExpression.EVALUATION_TIME_REPORT Note, this has also been described in:http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=9&id=37662#37662 kind regards,Christiaan Link to comment Share on other sites More sharing options...
medopal Posted April 7, 2008 Author Share Posted April 7, 2008 thank u, its working now i thought Page_count should count all the pages, but it seems to work on records. ur suggestion works great, thanks Link to comment Share on other sites More sharing options...
svrco Posted August 17, 2017 Share Posted August 17, 2017 Hi, I have a big problem. I need to pass information about current page and total page count into the BARCODE.I can choose, even I want to evaluate BARCODE with EVALUATION_TIME_NOW or EVALUATION_TIME_REPORT.But, if I choose EVALUATION_TIME_NOW, I have no idea how to get Total pages countif I choose EVALUATION_TIME_REPORT., I have no idea how to get Current page.IS THERE ANY SOLUTION ? Please ...... Link to comment Share on other sites More sharing options...
usbean061 Posted August 30, 2017 Share Posted August 30, 2017 Hi, I have done it on ireport 5.2.0 quite a while ago. Create a variable $V{REPORT_PAGE} with properties as below.Variable Class : IntegerCalculation : NothingReset Type : NoneIncrement Type : Page V.Expression : $V{PAGE_NUMBER}Now add a text item to your footer with expression as below."Page "+$V{REPORT_PAGE} +" of " +$V{PAGE_NUMBER}and SET Evaluation Time to Auto 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