Pagenumber Format in rml reports

Asked by Pravitha V

hello everyone...
how can i change the current page number format from page:1 ,page:2 etc to something different...that is to page:1/2 in the first page and page:2/2 in the second page...
how can i do this ? i am using openerp6.0
currently i use the following code in the company page in the openerp interface to get the page number..

Code:
<drawCentredString x="18.5cm" y="1.5cm"> Page: <pageNumber/></drawCentredString>

_________________
Regards,
Nightfury

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Pravitha V
Solved:
Last query:
Last reply:
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#1

First couple of hits on google will tell you to use the <pageCount/> directive.

Revision history for this message
Pravitha V (pravithavarghese1) said :
#2

i tried this <pageCount/> but it gave me the following output

page: 0 in the first page
page:0 in the second page

Revision history for this message
Pravitha V (pravithavarghese1) said :
#3

please help

Revision history for this message
Pravitha V (pravithavarghese1) said :
#4

this is the code i added
code:
<drawRightString x="19.5cm" y="0.3cm">Page: <pageCount/></drawRightString>

Revision history for this message
Numérigraphe (numerigraphe) said :
#5

Maybe you're hitting Bug #516966 ?
Lionel

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#6
Revision history for this message
Pravitha V (pravithavarghese1) said :
#7

hey thanks Numérigraphe (numerigraphe) ,
your answer really helped.. thankyou

# HG changeset patch
# Parent 3fda5d5bbae001d42c56b5281e56fb2be0c8aa58
[FIX] use real page count for <pageCount/> flowable

diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py
--- a/bin/report/render/rml2pdf/trml2pdf.py
+++ b/bin/report/render/rml2pdf/trml2pdf.py
@@ -118,7 +118,7 @@
     def draw(self):
         self.canv.beginForm("pageCount")
         self.canv.setFont("Helvetica", utils.unit_get(str(8)))
- self.canv.drawString(0, 0, str(self.canv.getPageNumber()))
+ self.canv.drawString(0, 0, str(self.canv._pageCount))
         self.canv.endForm()

 class PageReset(platypus.Flowable):