• Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding to PAGE_NUMBER Variable  RSS feed

 
Ranch Hand
Posts: 1838
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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}
 
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll move this to our "Other Open Source Projects" forum, where you might be able to get an answer.
 
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ice is for people that are not already cool. Chill with this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!