I have a situation where i need page number in footer in this format:
--------------------------------------------------------------------------------
page 1 of 4212 printed date:
page no should be left align to left margin. i used this expression
"Page "+$V{PAGE_NUMBER}+ " of "+ $V{PAGE_NUMBER}
but it always give output
"Page 1 of 1"
how to achieve it in single text field which is left aligned??? please help me to sort out this.
See: http://community.jaspersoft.com/questions/893771/printing-page-x-y-single-textfield-logic-jasper-ultimate-guide-section-1922
Create a variable with this definition (note the resetType)
<variable name="currentPageNumber" class="java.lang.Integer" resetType="Page">
<variableExpression><![CDATA[$V{PAGE_NUMBER}]]></variableExpression>
</variable>
Page number Field (note the evaluation Time):
<textField evaluationTime="Auto">
<reportElement uuid="847e339f-a1a6-492d-868b-b233f71785b4" x="166" y="22" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{currentPageNumber} + " of " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With