Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
8459 Vistas

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
Descartar

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

Mejor respuesta

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
Descartar
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

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
1564
1
sept 22
3516
3
feb 21
6352
0
feb 17
2830
1
mar 15
5922