Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to use pto_header in RML?

By
Juan Formoso
on 11/4/14, 5:16 AM 1,482 views

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 weirder.

Can anyone explain me what I am doing wrong?

2
Juan Formoso
On 11/5/14, 12:32 PM

I found a double solution:

1. Keep the same code and repeat the content of <pto_header></pto_header> just after the </pto_header> tag.

2. The other solution is not to use <pto>, make only one blockTable (instead of one for the header and other for the content) and set its property repeatRows="1" (if the row you want to repeat in each page is the first one).

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/4/14, 5:16 AM
Seen: 1482 times
Last updated: 3/16/15, 8:10 AM