Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
8553 Представления

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

Related Posts Ответы Просмотры Активность
1
мар. 24
1653
1
сент. 22
3583
3
февр. 21
6428
0
февр. 17
2929
1
мар. 15
6028