Word Wrapping in .rml Reports in Openerp

Is there a way to wrap words in an rml template in openerp6.0. I determined the column width to get the product name in the openerp customer order template. But when long names are added without space, just go the column to the rml template report separately. Can anyone suggest a solution to this problem.

+3
source share
3 answers

I do not think this is supported out of the box. I suggest you add some methods to the objects you want to display that will provide values ​​wrapped in a given column length (caution, this becomes very complicated if you use a proportional font, better stick to a fixed width for this).

textwrap Python .

+3

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>
+2

I suggest you use the parawrap tag as follows:

<parawrap>[[o.name]]</parawrap>

This example is used to display the name of an object.

0
source

All Articles