Jump to content
We've recently updated our Privacy Statement, available here ×

how to get total page number and hide/show fields in jasper report


sumitotari09

Recommended Posts

HI

     I am using IReport for desighing Jasper reports.I am new i Jasper report. I want to know how to get total number of pages and based on this how to hide/show contents on page.

One more question can i extract variables,parameters and feilds of jasper report in java code?

Pleas help me its argent

 

thanks in advance.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Get total pages:

        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)

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