Jasper Reports Show “Page X of Y” using a single text field

前端 未结 8 1337
無奈伤痛
無奈伤痛 2020-11-28 10:20

I would like to create one text field that contains Page X of Y, without splitting it in two parts, as per the common solution. My textfield contains \"Pa

相关标签:
8条回答
  • 2020-11-28 11:21

    This work for my (little different of Dave's Answer)

    *Using JasperSoft Studio

    Then put a Text field with the expression:

    "Pág. " + $V{PAGE_NUMBER} +"/" + $V{V_CURRENT_PAGE_NUMBER}
    

    Hope this help!

    0 讨论(0)
  • 2020-11-28 11:26

    This should help, by using evaluationTime as Report

       <textField>
            <reportElement x="497" y="0" width="32" height="12" forecolor="#7E8083"
                               uuid="ef663cfd-4058-40bb-a6d9-de7f9a8164be"/> --update your elements here
            <textElement textAlignment="Right" verticalAlignment="Middle">
                <font fontName="SansSerif" size="7" pdfFontName="OpenSans-Regular.ttf"/>
            </textElement>
            <textFieldExpression>
                <![CDATA["Page " + $V{PAGE_NUMBER} + " of"]]>
            </textFieldExpression>
       </textField>
       <textField evaluationTime="Report">
            <reportElement x="529" y="0" width="7" height="12" forecolor="#7E8083"
                               uuid="ef663cfd-4058-40bb-a6d9-de7f9a8164be"/>  --update your elements here
            <textElement textAlignment="Right" verticalAlignment="Middle">
                <font fontName="SansSerif" size="7" pdfFontName="OpenSans-Regular.ttf"/>
                </textElement>
                <textFieldExpression>
                    <![CDATA[$V{PAGE_NUMBER}]]>
                </textFieldExpression>
       </textField>
    
    0 讨论(0)
提交回复
热议问题