13.07.2015 Views

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Additional ToolsFigure 19-3Date and time format dialogThe result is a new textfield element of type java.util.Date. The textfield expression is set to new java.util.Date()(this expression creates a new Date object initialized with the current date). The Pattern property of the textfield is set to theformat specified by the user.19.2 Page Number, Total Pages and Page X of Y Tools19.2.1 Page Number ToolsAll of these tools display page numbers:Page NumberTotal PagesPage X of YThis tool creates a textfield showing the variable $V{PAGE_NUMBER} at evaluation time now.The result is the number of the current page.This is very similar to Page Number, but the evaluation time set for the created textfield isReport. The result is the total number of pages of the report (that is, the value of the built-invariable PAGE_NUMBER at evaluation time Report; in other words, at the end of the document).Page X of Y creates two textfields:• The first is very similar to the one created by the Page Number tool, but the expressiondisplayed is "Page "+$V{PAGE_NUMBER}+" which produces something like Page 100 of(in this sample 100 is the current page).• The second textfield displays the variable $V{PAGE_NUMBER} at evaluation time Report(just like Total Pages). Please note that the string Page X of Y can be printed by using just asingle textfield, but this involves creating a new variable, as explained in the next section.For more information about PAGE_NUMBER and evaluation times, see 6.3, “Working with Variables,” on page 107 and 6.4,“Evaluating Elements During Report Generation,” on page 109.19.2.2 Printing Page X of Y in a Single TextfieldTo keep things simple, the Page X of Y tool creates two textfields that print the current and last page numbers of a report (boththese values are held by the variable PAGE_NUMBER which is evaluated at different times, Now and Report).347

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!