Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
21812 Weergaven

I am working with qweb reports in odoo 10 . Here is what i did

<odoo>
<template id="report_customer">
    <t t-call="report.html_container">
        <t t-set="data_report_margin_top" t-value="50"/>
        <t t-foreach="range(5)" t-as="1">
            <t t-foreach="docs" t-as="o">
            <t t-call="report.internal_layout">
                <div class="page example-css-class">
                    <h2>Report title</h2>
                    <p>This object's name is
                        <span t-field="o.full_name"/>
                    </p>
                    <ul class="list-inline">
                         <li>Page:</li>
                         <li><span class="page"/></li>
                         <li>/</li>
                         <li><span class="topage"/></li>
                    </ul>
                </div>
            </t>
        </t>
        </t>
    </t>
</template>
</odoo>

and i also tried this

<odoo>
<template id="report_customer">
    <t t-call="report.html_container">
        <t t-set="data_report_margin_top" t-value="50"/>
        <t t-foreach="range(5)" t-as="1">
            <t t-foreach="docs" t-as="o">
            <t t-call="report.internal_layout">
                <div class="page example-css-class">
                    <h2>Report title</h2>
                    <p>This object's name is
                        <span t-field="o.full_name"/>
                    </p>
                    <div class="footer" style="text-align: center !important;">
                      Page  <span class="page"/> of <span class="topage"/>
                    </div>
                </div>
            </t>
        </t>
        </t>
    </t>
</template>
</odoo>

but in both cases i am not able to see page numbers. I also tried adding custom header and footer in separate templates but that also doesn't work.

Avatar
Annuleer

you can call <t t-call="report.external_layout_footer" /> on your custom template right? or what is the actual problem, Whether the Page is printed on sheet? if not then it could be your css problem

Beste antwoord

HI,

try this because it works in my custom qweb report,

in your case, you should place <div class="footer"> after complete <div class="page" >.

<t t-call="report.external_layout">

    <div class="page" >

                page content whatever you print in Body Part or Report ... 

    </div

<div class="footer">

    <div class="row" style="font-size:8;">

        <div class="col-xs-6 text-left">

              <span t-esc="time.strftime('%Y-%m-%d %H:%M:%S')"/>

        </div>

        <div class="col-xs-6 text-right">

             Page <span class="page"/> of <span class="topage"/>

        </div>

    </div>

</div>

</t>

Thanks

Avatar
Annuleer
Beste antwoord

Remember the page number only shows when the report type is PDF, In HTML format page number will not shown. Here we will display page number in this (page X of Y) format. In my case I am not using external_layout_footer in my reports. I instead have using footer class (class="footer").

<!--Report Body Section Goes Here-->
<div class="footer" style="position:absolute; margin:0px; padding:0px">
<span class="page"/>/<span class="topage"/>
</div>

You can check more details of show page numbers in qweb report: http://learnopenerp.blogspot.com/2017/11/how-to-add-page-number-in-qweb-reports.html



Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 22
1593
0
nov. 18
4809
0
feb. 23
1873
3
aug. 19
12519
2
dec. 18
12828