Jump to content
Changes to the Jaspersoft community edition download ×

about PAGE_NUMBER


Recommended Posts

By: Winny Zhang - winnyzhang

about PAGE_NUMBER

2003-08-21 03:29

I am using jasper report to design PDF report now.

I found it's difficult to distinguish the current page number and the total number ,the only way is to set evaluationTime attribute.But

I want to print PAGE_NUMBER at each page if the total page number is more than 1,if the total page number is 1, I don't want to print page number .

 

How can I do?Help!

Thanks a lot!

Winny

 

 

 

 

By: David Hardwick - dhardwick

RE: about PAGE_NUMBER

2003-08-21 08:52

Use the printWhenExpression to not print the item when pagenumber is less than 2.

 

 

 

 

 

 

 

 

By: Jeff Erlandsson - theace

RE: about PAGE_NUMBER

2003-08-22 05:08

Try this expression in the printWhenExpression:

($V{PAGE_NUMBER}.equals(new Integer(1))?Boolean.FALSE:Boolean.TRUE)

 

- Jeff

 

 

 

 

By: Winny Zhang - winnyzhang

RE: about PAGE_NUMBER

2003-08-21 18:37

Thanks.

Use the printWhenExpression to not print the item when pagenumber is less than 2.the result is it won't print page numer at page 1 and print page number at other pages when the total page number is more than one.

 

I hope print page number at each page when the the total page number is more than one.

and won't print pagenumber when is has only one page at that report.

 

pls help me.Thanks a lot!

 

 

 

 

 

 

 

 

 

By: Ryan Johnson - delscovich

RE: about PAGE_NUMBER

2003-08-22 10:34

This is a little inelegant, but the only way I know of to do that is to use two text fields:

 

The first one evaluates now and has a printwhen page > 1. It prints $P{PAGE_NUMBER}

 

The second is a static text field that evaluates at the report's end and has a printwhen for page != 1.

It prints "1".

 

That way, when you have a 1 page report, the first one is invisible, and so is the second, but when you have 2+ pages, the first one takes care of all the pages but the first and the second gets the first page.

 

Good luck,

Ryan

 

 

 

 

By: Winny Zhang - winnyzhang

RE: about PAGE_NUMBER -to delscovich

2003-08-22 21:10

Great!

 

You are so wanderful!

 

Thank you!

 

Winny

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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