コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
22209 ビュー

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.

アバター
破棄

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

最善の回答

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

アバター
破棄
最善の回答

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



アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 22
1721
0
11月 18
4955
0
2月 23
2035
3
8月 19
12714
2
12月 18
12991