跳至内容
菜单
此问题已终结

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>
形象
丢弃

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

最佳答案

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""/>


形象
丢弃
编写者

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

编写者

Worked for me! Thanks bro

相关帖文 回复 查看 活动
1
3月 24
1650
1
9月 22
3583
3
2月 21
6422
0
2月 17
2927
1
3月 15
6016