cleveland.o.burnett1 Posted January 31, 2023 Share Posted January 31, 2023 ISSUE: Page number is not displaying on all pages in the report. Report contains three subreports. Specifically, the preview displays Page 33 of 38 or Page 24 of 25. I expected the report to display 1 of 38, 2 of 38, 3 of 38, 4 of 38, 5 of 38, so on.Within the "Page Footer" section of the Report Inspector, I create this text field."Page " +$V{currentPage}+" of " + $V{PAGE_NUMBER}Expression Class is java.lang.StringEvaluation time is AutoNote: I created variable $V{currentPage} with class = java.lang.Integer, Calculation = Nothing, Reset Type = Page, Variable Expression = $V{PAGE_NUMBER}, and all other properties are default values. What am I doing wrong? What specific steps should I perform to have page numbers display on every page instead of the last few pages. Thanks. Link to comment Share on other sites More sharing options...
mahadiosb Posted February 1, 2023 Share Posted February 1, 2023 Page number element not placed on all bands: Ensure that the page number element is placed on the correct band (e.g., page header, page footer) and that it is present on all sub-reports as well.Please click on Summery with page header and footer Link to comment Share on other sites More sharing options...
jgust Posted February 1, 2023 Share Posted February 1, 2023 The issue is that $V{PAGE_NUMBER} does not account for sub-reports. You will need to update the page number expression and use the $V{MASTER_CURRENT_PAGE} and $V{MASTER_TOTAL_PAGES} built-in variables. Also, set the evaluation time on that expression to Master.<textField evaluationTime="Master" isBlankWhenNull="true"> <reportElement x="760" y="12" width="150" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="02a85f92-befb-40fc-b214-9099b4d17de8"> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <textElement textAlignment="Right"> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA["Page " + TEXT($V{MASTER_CURRENT_PAGE}, "#,###") + " of " + TEXT($V{MASTER_TOTAL_PAGES}, "####")]]></textFieldExpression></textField>[/code] Link to comment Share on other sites More sharing options...
cleveland.o.burnett1 Posted February 3, 2023 Author Share Posted February 3, 2023 I failed to mention that I am working with Jaspersoft iReport Designer 5.6.0. Would the page number solution be different for this Jaspersoft iReport version? Thanks again for any direction. 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