Jump to content

Recommended Posts

Posted
In the Jaspersoft Studio in preview mode, report has 6 pages with the following numeration:

 

  • 1/10
  • 2/10
  • 3/10
  • 4/10
  • 5/10
  • 6/0

 

First parameter is PAGE_NUMBER. It's ok. Second parameter is PAGE_COUNT. It's incorrectly counts sum of pages and at the last page it reset value to zero. What could be the problem?

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

$P{PAGE_COUNT} contains the current number of records processed in the current page. If what you want is page 1 of 6, 2 of 6, ..... 6 of 6 display for the page, using two ${PAGE_NUMBER} with different evaluation time should do the trick:

    <pageFooter>        <band height="54" splitType="Stretch">            <textField>                <reportElement x="168" y="22" width="128" height="20"                               uuid="7d0ee7ca-0923-4c49-86c6-c0d1b888912e"/>                <textElement textAlignment="Right"/>                <textFieldExpression>                    <![CDATA["Page "+$V{PAGE_NUMBER}]]>                </textFieldExpression>            </textField>            <textField evaluationTime="Report">                <reportElement x="296" y="22" width="100" height="20"                               uuid="ee21464a-dccf-491b-afa3-7c299b3108ae"/>                <textFieldExpression>                    <![CDATA[" of "+$V{PAGE_NUMBER}]]>                </textFieldExpression>            </textField>        </band>    </pageFooter>[/code]

Note:

  • default evaluation time is Now

  • default text aligment is Left

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