henry.cui Posted September 12, 2016 Share Posted September 12, 2016 Hello Jaspersoft Community,I have the following requirement:1. If the report has more than 1 page, display the page number on the right, display text "For internal Use Only" on the left.2. If the report has 1 page, do not display the page number, display text "For internal Use Only" in the middle.I googled it, and someone suggested the following:/**************************************************************************************************** Create a variable like: <variable name="totalPages" class="java.lang.Integer" resetType="None" incrementType="Report"> <variableExpression><![CDATA[$V{PAGE_NUMBER}]]></variableExpression> </variable>Based in variable totalPages to hide/show contents on page: In some element of page set in property 'Print When Expression' a expression, for example: ($V{totalPages} == 1) || ($V{totalPages} == 2) || ($V{totalPages} % 2 == 0)*****************************************************************/This does not work for me. Both pages put the text "For internal Use Only" in the middle. There is no page number.Some people suggested this cannot be done because "We cannot use late evaluation in variables".How to solve my scenario? 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