Is there any way to wrap words in rml template in openerp6.0.I have defined a column width to get the product's name in sales order template of openerp.But when long names without space is added it just cross the column in the rml template report alone.Can anyone sugest a solution for this problem.
3 Answers
3
votes
I don't think this is supported out of the box. I suggest that you add some methods to the objects you want to display that will provide the values wrapped to a given column length (careful, this gets very tricky if you use a proportional font, better stick with fixed width for this).
The textwrap module of the Python standard library may be of use in writing these methods.
2
votes
Just enclose the content of the cell in a para tag. Here is an example:
<!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>