Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9615 มุมมอง

hi,  I would like to know how to set maximum displayed rows table in qweb report. for example i need 5 rows in the first page and the other rows the second page.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Yasmina,

You could work with a variable which you use as a counter in the for loop. Every time the counter is dividible by a number (for example 5) you can add a page break to display the next records on the following page. Something along the lines of:

<tr t-foreach="o.your_lines" t-as="line">
    <td>
        <span t-esc="line.name"/>
    </td>
    <t t-set="i" t-value="i+1"/>
    <!-- This will only be on every fifth row. Page break after -->
    <t t-if="i % 5 == 0">
        <div style="page-break-before:always;"></div>
    </t>
</tr>


Regards,
Yenthe

อวตาร
ละทิ้ง
ผู้เขียน

thank you , but whene i used this solution it break and all the table is in the second page. and me i want to get 5 rows in the first page ...

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 23
10526
0
ต.ค. 17
3442
0
พ.ย. 16
2714
0
ต.ค. 16
4964
0
ส.ค. 16
3103