how to display page x of y in jasper report 5.5.1 in "single textfield" its giving alignment issue? -


i have situation need page number in footer in format:

-------------------------------------------------------------------------------- page 1 of 4212                                              printed date: 

page no should left align left margin. used expression

"page "+$v{page_number}+ " of "+ $v{page_number} 

but give output

"page 1 of 1" 

how achieve in single text field left aligned??? please me sort out this.

see: http://community.jaspersoft.com/questions/893771/printing-page-x-y-single-textfield-logic-jasper-ultimate-guide-section-1922

create variable definition (note resettype)

<variable name="currentpagenumber" class="java.lang.integer" resettype="page"> <variableexpression><![cdata[$v{page_number}]]></variableexpression> </variable> 

page number field (note evaluation time):

<textfield evaluationtime="auto"> <reportelement uuid="847e339f-a1a6-492d-868b-b233f71785b4" x="166" y="22" width="100" height="20"/> <textelement/> <textfieldexpression><![cdata[$v{currentpagenumber} + " of " + $v{page_number}]]></textfieldexpression> </textfield> 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -