title: Jasper Reports: center current page number and total page number
body: <p>I want to print the current page number and the total page number in the page footer of a Jasper Reports report as phrase like "page 2 of 10". The phrase must be centered between the page margins. The text pattern is locale dependent.</p>
  
  <p>The natural approach would seen to use a message pattern to do the formatting and and translation, e.g. msg($R{msg_page_number}, $V{PAGE_NUMBER}, $V{TOTAL_PAGE_NUMBERS}). This is not possible because there is no variable like TOTAL_PAGE_NUMBERS. One has to evaluate the PAGE_NUMBER variable at different times of the report layout. As a consequence one has to use multiple text elements to print the line. This makes centering very hard as none of the text element is actually at the center of the page.</p>
  
  <p>Is there a way to print the current page number and the total page numbers in a phrase like "$R{page} X $R{of} Y" horizontally centered on the page?</p>