Jump to content

How to use Page_Number in java class


diptypatil

Recommended Posts

Hi ,

 

I want to print page numbers using jasper can u tell me how to use PAGE_NUMBER , i have used this:

 

JRDesignTextField textPageNumber = new JRDesignTextField();

JRDesignExpression pageNumber = new JRDesignExpression();

 

pageNumber.setText("new Boolean(($V{PAGE_NUMBER}).intValue() == 1)");

 

pageNumber.setValueClassName("java.lang.Boolean");

textPageNumber.setPrintWhenExpression(pageNumber);

footer.addElement(textPageNumber);

 

but iam not getting any valie ....pleaase help me

dipty

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

When I understand you right, you want to display the pageNumber just on first page...

 

But you just set the PrintWhenExpression and not the TextExpression.

 

This should be something like "$V{PAGE_NUMBER}" of class Integer with evaluation time "now" for current pagenumber or evaluation time "report" for total pagenumbers.

 

Don't know the exact syntax for adding it by code as I just use designer (iReport) for designing reports. :-)

 

hth

C-Box

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