1

I have to print a table that may occupy more than one page depending on its size. For this, I did a repeatIn with a blockTable that prints the rows one by one but, when it is close to the end of the page, openerp shows the following error message:

"Print error The document you are trying to print contains a table row that does not fit on one page. Please try to split it in smaller rows or contact your administrator."

How to resolve this issue?

P.S.: I tried with a condPageBreak but it seems to be that does not work with this tag.

Here is my code below:

<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first"> <!-- 481 728 -->
  <frame id="first" x1="57.0" y1="57.0" width="750" height="500"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla1">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla2">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla3">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla5">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla4">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla6">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla7">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla8">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
  <blockFont name="Helvetica" size="8" />
  <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
  <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
</blockTableStyle>

<blockTableStyle id="Tabla9">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
  <lineStyle kind="GRID" colorName="#000000"  />
  <lineStyle kind="GRID" colorName="#000000"  />
</blockTableStyle>

<blockTableStyle id="Tabla10">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla11">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<initialize>
  <paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica" fontSize="14.0" leading="17"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="12.0" leading="15"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="11" alignment="LEFT"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="13" alignment="CENTER"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0"         spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<images/>
</stylesheet>
<story>
<para style="P3">[[ repeatIn(objects,'partida') ]]</para>
<para style="P1">Registro de Contralor</para>
<para style="P3">
  <font color="white"> </font>
</para>
<para style="P3">
  <font color="white"> </font>
</para>
<blockTable colWidths="74.0,408.0" style="Tabla1">
  <tr>
    <td>
      <para style="P3">Período:</para>
    </td>
    <td>
   <para style="P5">[[ partida.period_id.name ]]</para>
    </td>
  </tr>
  <tr>
    <td>
      <para style="P3">Moneda:</para>
    </td>
    <td>
      <para style="P5">[[ partida.currency_id.name ]]</para>
    </td>
  </tr>
  <tr>
    <td>
      <para style="P3">Misión:</para>
    </td>
    <td>
      <para style="P5">[[ partida.company_id.name ]]</para>
    </td>
  </tr>
</blockTable>
<para style="P3">
  <font color="white"></font>
</para>
<blockTable style="Tabla2">
  <tr>
    <td>
      <para style="P3">Líneas de contralor</para>
    </td>
  </tr>
  <tr>
    <td>
      <blockTable colWidths="80,60,105,105,80,60,60,80,80" style="Tabla9">
    <tr>
    <td><para style="P9">Factura</para></td>
    <td><para style="P9">Fecha de pago</para></td>
    <td><para style="P9">Cód./Obj. del gasto</para></td>
    <td><para style="P9">Partida descripción</para></td>
    <td><para style="P9">Factura original</para></td>
    <td><para style="P9">Ingreso</para></td>
    <td><para style="P9">Egreso</para></td>
    <td><para style="P9">Ref. de pago</para></td>
    <td><para style="P9">Diario</para></td>
    </tr>
   </blockTable>
<section>
       <para style="P3">[[ repeatIn(partida.contralor_ids,'contralor_id') ]]</para>
   <blockTable colWidths="80,60,105,105,80,60,60,80,80" style="Tabla9">
        <tr>
          <td>
            <para style="P9">[[ contralor_id.invoice_id.number ]]</para>
          </td>
          <td>
            <para style="P9">[[formatLang(contralor_id.fecha_pago,date=True)[:2] ]]/[[ formatLang(contralor_id.fecha_pago,date=True)[3:5] ]]/[[ formatLang(contralor_id.fecha_pago,date=True)[6:10] ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.product_id.name ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.partida_id.name ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.invoice_original_id.number ]]</para>
          </td>
          <td>
            <para style="P9">[[ ('%.2f' % contralor_id.ingreso).replace('.', ',') ]]</para>
          </td>
          <td>
            <para style="P9">[[ ('%.2f' % contralor_id.egreso).replace('.', ',') ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.ref_pago ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.journal_id.name ]]</para>
          </td>
        </tr>
      </blockTable>
</section>
    </td>
    <td>
    </td>
  </tr>
</blockTable>
</story>
</document>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • this may help (https://www.odoo.com/forum/help-1/question/if-prodcut-information-is-too-long-then-rml-pdf-report-having-problem-37241) – Vigneshwaran Thenraj Nov 05 '14 at 04:14
  • I tried with this link (adding a limit to the string's value and the row heights) and the error persists: "LayoutError: Flowable with cell(0,0) containing " with cell(0,0) containing\n'Factura'"(738.0 x 1206.0) too large on page 2 in frame u'first'(738.0 x 488.0*) of template u'first' " – Pablo Carballo Nov 05 '14 at 13:57
  • I found where was the error!! The blockTable was inside a td tag and it appears to be that RML doesn't let you to split the blockTable rows that are inside a td.Then I put the blockTable out of the td of the another outer table and the problem was solved. – Pablo Carballo Nov 05 '14 at 14:49
  • Please kindly update your answer, for further reference. – Vigneshwaran Thenraj Nov 06 '14 at 03:51

1 Answers1

0

I found where was the error!! The blockTable was inside a td tag and it appears to be that RML doesn't let you to split the blockTable rows that are inside a td.Then I put the blockTable out of the td of the another outer table and the problem was solved.

Here is my fixed code:

<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first"> <!-- 481 728 -->
  <frame id="first" x1="57.0" y1="57.0" width="750" height="500"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla1">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla2">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla3">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla5">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla4">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla6">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla7">
  <blockAlignment value="LEFT"/>
  <blockLeftPadding length="15"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla8">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
  <blockFont name="Helvetica" size="8" />
  <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
  <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
</blockTableStyle>

<blockTableStyle id="Tabla9">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
  <lineStyle kind="GRID" colorName="#000000"  />
  <lineStyle kind="GRID" colorName="#000000"  />
</blockTableStyle>

<blockTableStyle id="Tabla10">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tabla11">
  <blockAlignment value="LEFT"/>
  <blockValign value="TOP"/>
</blockTableStyle>
<initialize>
  <paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica" fontSize="14.0" leading="17"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="12.0" leading="15"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="11" alignment="LEFT"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="13" alignment="CENTER"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<images/>
</stylesheet>
<story>
<para style="P3">[[ repeatIn(objects,'partida') ]]</para>
<para style="P1">Registro de Contralor</para>
<para style="P3">
  <font color="white"> </font>
</para>
<para style="P3">
  <font color="white"> </font>
</para>
<blockTable>
<tr>
<td>
<blockTable colWidths="105.0,350.0" style="Tabla1">
  <tr>
    <td>
      <para style="P3">Período:</para>
    </td>
    <td>
   <para style="P5">[[ partida.period_id.name ]]</para>
    </td>
  </tr>
  <tr>
    <td>
      <para style="P3">Moneda:</para>
    </td>
    <td>
      <para style="P5">[[ partida.currency_id.name ]]</para>
    </td>
  </tr>
  <tr>
    <td>
      <para style="P3">Misión:</para>
    </td>
    <td>
      <para style="P5">[[ partida.company_id.name ]]</para>
    </td>
  </tr>
  <tr>
<td>
   <para style="P3">Líneas de contralor</para>
</td>
<td>
   <para></para>
</td>
  </tr>
</blockTable>
</td>
<td>
</td>
</tr>
</blockTable>
<para style="P3">
  <font color="white"></font>
</para>
      <blockTable rowHeights="30" repeatRows="1" colWidths="80,60,105,105,80,60,60,80,80" style="Tabla9">
    <tr>
    <td><para style="P9">Factura</para></td>
    <td><para style="P9">Fecha de pago</para></td>
    <td><para style="P9">Cód./Obj. del gasto</para></td>
    <td><para style="P9">Partida descripción</para></td>
    <td><para style="P9">Factura original</para></td>
    <td><para style="P9">Ingreso</para></td>
    <td><para style="P9">Egreso</para></td>
    <td><para style="P9">Ref. de pago</para></td>
    <td><para style="P9">Diario</para></td>
    </tr>
   </blockTable>
<section>
       <para style="P3">[[ repeatIn(partida.contralor_ids,'contralor_id') ]]</para>
   <blockTable colWidths="80,60,105,105,80,60,60,80,80" style="Tabla9">
        <tr>
          <td>
            <para style="P9">[[ contralor_id.invoice_id.number ]]</para>
          </td>
          <td>
            <para style="P9">[[ formatLang(contralor_id.fecha_pago,date=True)[:2] ]]/[[ formatLang(contralor_id.fecha_pago,date=True)[3:5] ]]/[[ formatLang(contralor_id.fecha_pago,date=True)[6:10] ]]</para>
          </td>
          <td>
            <para style="P9">[[  len(contralor_id.product_id.name) > 100 and contralor_id.product_id.name[:100] + ' ...' or contralor_id.product_id.name ]]</para>
          </td> 
          <td>
            <para style="P9">[[  len(contralor_id.partida_id.name) > 100 and contralor_id.partida_id.name[:100] + ' ...' or contralor_id.partida_id.name ]]</para>
          </td>
          <td>
            <para style="P9">[[ contralor_id.invoice_original_id.number ]]</para>
          </td>
          <td>
            <para style="P9">[[ ('%.2f' % contralor_id.ingreso).replace('.', ',') ]]</para>
          </td>
          <td>
            <para style="P9">[[ ('%.2f' % contralor_id.egreso).replace('.', ',') ]]</para>
          </td>
          <td>
            <para style="P9">[[ len(contralor_id.ref_pago) > 100 and contralor_id.ref_pago[:100] + ' ...' or contralor_id.ref_pago ]]</para>
          </td>
          <td>
            <para style="P9">[[ len(contralor_id.journal_id.name) > 100 and     contralor_id.journal_id.name[:100] + ' ...' or contralor_id.journal_id.name ]]</para>
          </td>
        </tr>
      </blockTable>
</section>
</story>
</document>