Jump to content
Changes to the Jaspersoft community edition download ×

Page number is not displaying on all pages in the report. Report contains subreports.


cleveland.o.burnett1

Recommended Posts

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.String

Evaluation time is Auto

Note:  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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...