1

I did a report, which was working perfect, but I realized that when there are several pages, the header and the footer were being shown only in the first page.

So I started to use <pto>, <pto_header> and <pto_trailer>. But these are not working as expected. For example, when I only use pto_header:

<story>
    <pto>
        <pto_header>
            <para style="P1">
                <font color="white"> </font>
            </para>
            <blockTable colWidths="480.0" style="Table1">
                <tr>
                    <td>
                        <para style="header_td">My column</para>
                    </td>
                </tr>
            </blockTable>
        </pto_header>
        <blockTable colWidths="480.0" style="Table2">
            <tr>
                <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
                <para style="terp_default_8">[[ setLang(o.lang) ]]</para>
                <td>
                    <para>[[ o.name or '' ]]</para>
                    <para>
                        <font color="white"> </font>
                    </para>
                </td>
            </tr>
        </blockTable>
    </pto>
</story>

The result is that the section I declared as the pto_header is only being shown at the last page of the report. And if I declare a pto_trailer the result is the other way round. The pto_trailer is only shown at the very first page.

Can anyone explain me what I am doing wrong?

forvas
  • 9,801
  • 7
  • 62
  • 158

1 Answers1

2

try this might be helpful to you.

<story>
<pto>
    <pto_header>
        <para style="P1">
            <font color="white"> </font>
        </para>
        <blockTable colWidths="480.0" style="Table1">
            <tr>
                <td>
                    <para style="header_td">My column</para>
                </td>
            </tr>
        </blockTable>
    </pto_header>
    <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
    <para style="terp_default_8">[[ setLang(o.lang) ]]</para>
     <blockTable colWidths="480.0" style="Table1">
            <tr>
                <td>
                    <para style="header_td">My column</para>
                </td>
            </tr>
     </blockTable>
    <blockTable colWidths="480.0" style="Table2">
        <tr>
            <td>
                <para>[[ o.name or '' ]]</para>
                <para>
                    <font color="white"> </font>
                </para>
            </td>
        </tr>
    </blockTable>
</pto>          
</story>
Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
  • Great @Odedra!! This is working. Just one question: if I paste your code without modifications, the pto_header is working well but there is only one record being shown by page (so the report has a lot of pages). I have to put the paras with repeatIn and setLang like I had before, inside the Table2. Do you know why? – forvas Nov 04 '14 at 11:50
  • As per number of ids, it will print a separate document for each. And for standard use of `` is given in an answer. Also make sure this two line are come after `` finished. 1. repeatin and 2. setlang. Never put this 2 tag in any block table. Hope this will help you. – Bhavesh Odedra Nov 04 '14 at 11:58
  • Ok, I understand. But if I want to emulate the tree view of the object in the report, what I am doing would be right, wouldn't it? – forvas Nov 04 '14 at 12:13
  • if you want tree view than no need put in repeatIn in a blocktable. It will printed document. And try above code for in tree view that will be printed your tree view object. – Bhavesh Odedra Nov 04 '14 at 12:19