在openerp6.0中有没有办法在rml模板中换行?我已经定义了一个列宽来获得openerp.But的销售订单模板中的产品名称当添加没有空格的长名称时,只需在rml模板report alone.Can中跨列,任何人都可以为这个问题建议一个解决方案。
发布于 2012-04-24 15:07:52
我不认为这是开箱即用的支持。我建议你向你想要显示的对象添加一些方法,这些方法将提供给给定列长度的值(小心,如果你使用比例字体,这会变得非常棘手,最好是固定宽度)。
在编写这些方法时,可以使用Python标准库的textwrap模块。
发布于 2012-04-26 00:30:40
只需将单元格的内容包含在para标记中即可。下面是一个示例:
<!DOCTYPE document SYSTEM "rml.dtd" >
<document filename="wraps.pdf">
<template showBoundary="0">
<pageTemplate id="main">
<pageGraphics />
<frame id="first" x1="150" y1="400" width="250" height="400" />
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="blocktablestyle4">
<!-- show a grid: this also comes in handy for debugging your tables.-->
<lineStyle kind="GRID" colorName="green" thickness="1" start="0,0" stop="-1,-1" />
</blockTableStyle>
<paraStyle name="textstyle1" fontName="Helvetica" fontSize="9" textColor="blue" />
</stylesheet>
<story>
<blockTable style="blocktablestyle4" colWidths="2cm,2cm">
<tr>
<td>cell A</td>
<td>This doesn't wraps.</td>
</tr>
<tr>
<td>cell C</td>
<td>
<para style="textstyle1">to see how it works. This is yet more long text to demonstrate wrapping through "para" tag.</para>
</td>
</tr>
</blockTable>
</story>
</document>发布于 2014-05-13 18:37:33
我建议你这样使用parawrap标签:
<parawrap>[[o.name]]</parawrap>此示例用于显示对象的名称。
https://stackoverflow.com/questions/10292010
复制相似问题