openerp页码

openerp页码,openerp,Openerp,我尝试使用以下两种方法在文档中添加页码 我只想要默认的第1页,第2页等等 (一) -- 不走运!!我刚刚得到佩奇:或者 错误 提前感谢Usha,对于header=internal的报告,您将自动在报告中使用1/2样式的页面计数。 与openerp的报告一样,它对内部报告使用编号拉票。您只需在.rml中写入“”,但必须在“template/PageTemplate/pageGraphics”标记下写入。 例如: <template pageSize="(595.0,842.0)" title

我尝试使用以下两种方法在文档中添加页码

我只想要默认的第1页,第2页等等

(一)

--

不走运!!我刚刚得到佩奇:或者 错误


提前感谢Usha,对于header=internal的报告,您将自动在报告中使用1/2样式的页面计数。
与openerp的报告一样,它对内部报告使用编号拉票。

您只需在.rml中写入“”,但必须在“template/PageTemplate/pageGraphics”标记下写入。
例如:

<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate>
        <pageGraphics>
            <drawCentredString x="10.5cm" y="0.8cm">Page: <pageNumber/></drawCentredString>
        </pageGraphics>
    </pageTemplate>

第页:


希望这能解决您的问题。

谢谢Arya,我花了很长时间才弄明白,drawCentredString必须在pageGraphics中,而整个内容都必须在pageTemplate中。。我想知道我能在故事里放一节吗?你能分享你的gmail id吗?在插件中有很多关于这个部分的例子。
<para><drawCentredString x="18.5cm" y="1.5cm"> Page: <pageCount/></drawCentredString></para>
class PageCount(platypus.Flowable):
    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):
    def draw(self):
        self.canv._pageNumber = 0
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate>
        <pageGraphics>
            <drawCentredString x="10.5cm" y="0.8cm">Page: <pageNumber/></drawCentredString>
        </pageGraphics>
    </pageTemplate>