wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Adding to PAGE_NUMBER Variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Adding to PAGE_NUMBER Variable" Watch "Adding to PAGE_NUMBER Variable" New topic
Author

Adding to PAGE_NUMBER Variable

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
In JasperReports there is a PAGE_NUMBER variable. What is the syntax to add a specified number to this value?

I have tried $V{PAGE_NUMBER} + 1 but get a compile error.

What I really need:

"Page " + $V{PAGE_NUMBER} + myVariable + " of " + myVariable2 + $V{PAGE_NUMBER}
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9941
    
159

I'll move this to our "Other Open Source Projects" forum, where you might be able to get an answer.


[My Blog] [JavaRanch Journal]
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

PAGE_NUMBER is an Integer, so you need to:



I've never tried this with Java 1.5, so I'm not sure if the auto-boxing is transparent to Jasper or if Jasper does some sort of pre-processing and would throw an error anyway. But even if you're using Java 1.4 or 1.5, this should work.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
wood burning stoves
 
subject: Adding to PAGE_NUMBER Variable
 
Similar Threads
How to pick up a variable in maven.xml
page numbering problem
Page Number in Excel jasper Report
How to print Image on Each page
Doubt about method local class