Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

OpenERP 关于rml报表的修改



  • 写的不对的地方,请大家指正



  • 谢谢分享

    先顶再读



  • 向分享者致敬!



  • 赞......  支持分享....



  • 帮楼主加了

    
    

    标签,这样看起来清楚些。

    xml注释如果用 <!--  --> 这样双中划线括起来应该看起来更清晰些。



  • 再整理一下,一个rml表,主要包括以下几部分:

    第一部分:表的说明

    <br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;document filename=&quot;test.pdf&quot;&gt;<br />&nbsp; &lt;template pageSize=&quot;(204.0,842.0)&quot; title=&quot;Receipt&quot; author=&quot;OpenERP S.A. (sales@openerp.com)&quot; allowSplitting=&quot;20&quot;&gt;<br />&nbsp; &nbsp; &lt;pageTemplate id=&quot;first&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;frame id=&quot;first&quot; x1=&quot;0.0&quot; y1=&quot;0.0&quot; width=&quot;204&quot; height=&quot;800&quot;/&gt;<br />&nbsp; &nbsp; &lt;/pageTemplate&gt;<br />&nbsp; &lt;/template&gt;<br />
    


    第二部分 表的格式,包括每个表的格线等

    <br />&nbsp; &lt;stylesheet&gt;<br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Standard_Outline&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt; <br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Table10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;0,1&quot; stop=&quot;0,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;0,-1&quot; stop=&quot;0,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;1,1&quot; stop=&quot;1,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;1,-1&quot; stop=&quot;1,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;2,1&quot; stop=&quot;2,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;2,-1&quot; stop=&quot;2,-1&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt;<br />&nbsp; &nbsp; &lt;initialize&gt;<br />&nbsp; &nbsp; &nbsp; &lt;paraStyle name=&quot;all&quot; alignment=&quot;justify&quot;/&gt;<br />&nbsp; &nbsp; &lt;/initialize&gt;<br />&nbsp; &nbsp; &lt;/stylesheet&gt;<br />
    


    第三部分,表格内容

    <br /> &lt;story&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;68.0,68.0,68.0&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Description&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Qty&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Price&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ repeatIn(o.lines,&#039;line&#039;) ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ line.product_id.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font color=&quot;white&quot;&gt; &lt;/font&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][&#91;&#039;%.f&#039; % line.qty ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][[ formatLang(net(line.id), currency_obj=company.currency_id) ]] &lt;font face=&quot;Helvetica&quot;&gt;[[ line and line.discount == 0.0 and removeParentNode(&#039;font&#039;) ]] ([[ formatLang(line.discount, currency_obj=company.currency_id) ]])&lt;/font&gt;&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &lt;/story&gt;<br />&lt;/document&gt;<br />
    


    就是以上三部分控制着一个表格



  • 先占个座再慢慢拜读。。。。



  • 页眉页脚能通过rml文件直接修改吗


  • 管理员



  • 谢谢分享,还没到报表开发阶段呢,先mark



  • 刚接触没几天,正要修个页眉和页脚,看出来点思路来了,谢谢分享