Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
8485 Zobrazení

Hey i am making a custom report and because i needed an empty page so i used web.basic_layout and then i added my own header and all. But this basic_layout has left empty space on the top of my header and because of it my report is going at two pages. Can you tell me how to remove that extra spacing.

Following is just a chunk of code from my template to give an idea what i am doing. Kindly help. Thanks in advance.


<template id="new_report_nstp_template">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<div class="page" style="border-top: 5px solid green;border-bottom: 5px solid green;">
<div class="text-center" style="margin-top:-15%;z-index:999;">
<img src='/nstp_report/static/src/img/nstp.png' style="max-with: 100%;"/>
</div>
<br>
<br></br>
</br>
Avatar
Zrušit

Hi, If you have a paper-format for the report, try adjusting the top margin inside the paper-format, Thanks

Nejlepší odpověď

you can specify the space by paper format(change the margin top and bottom)
this is an exemple : 

<record id="paperformat_payslip_group"
model="report.paperformat">
<field name="name">European A4</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">10</field>
<field name="margin_bottom">10</field>
<field name="margin_left">5</field>
<field name="margin_right">5</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">43</field>
<field name="dpi">90</field>
</record>
<report id="print_report"
string="Print Report" model="your.model_name"
report_type="qweb-pdf"
name="your_module.new_report_nstp_template"
file="your_module.new_report_nstp_template"
paperformat="paperformat_payslip_group""/>


Avatar
Zrušit
Autor

Thanks for replying. One question...

should i specify this margin in negative? as i want my image header to be at the very start of page

Autor

Worked for me! Thanks bro

Related Posts Odpovědi Zobrazení Aktivita
1
bře 24
1604
1
zář 22
3551
3
úno 21
6374
0
úno 17
2891
1
bře 15
5958