4

I am defining my own report.paperformat. I am trying differnet configurations for margin_top and header_space but I can not manage to undersand what does each parameter.

  • When a given value is used inmargin_top and header_space, which are the units being used by wlkhtmltopdf?
  • What are exactly each value?
  • A value of 15 in margin_top and a value of 5 is used in header_line, what does that mean?
M.E.
  • 4,955
  • 4
  • 49
  • 128
  • Refer this official doc of odoo: https://www.odoo.com/documentation/10.0/reference/reports.html This may help you. – Keval Mehta Jan 20 '18 at 04:40
  • Official docs are poor in this specific case: `header_spacing` definition at official docs is `header spacing in mm` and `margin_top` description is `margin sizes in mm`. I expect a definition not to include the term to be defined, or at least not JUST include the term to be defined.. – M.E. Jan 20 '18 at 21:50

2 Answers2

7

Please see below image.

Odoo Qweb Margin

if you increase the Header spacing you also need to adjust the top margin as well. above image was using

  • Top Margin (mm) = 40.00
  • Header Spacing = 35.00

hope this helps to understand Top Margin and Header Spacing parameter!

Atul Arvind
  • 16,054
  • 6
  • 50
  • 58
  • That is what I was expecting from `header_spacing` and `margin_top`, but my tests give different results. According to your statement, changing header spacing shall not alter at all header, and in the tests I have done it does. – M.E. Jan 20 '18 at 21:51
1

For more add this to your report.

<record id="paperformat_sales" model="report.paperformat">
    <field name="name">A4 Sale Order</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">8</field>
    <field name="margin_bottom">0</field>
    <field name="margin_left">3</field>
    <field name="margin_right">0</field>
    <field name="header_line" eval="False" />
    <field name="header_spacing">5</field>
    <field name="dpi">90</field>
</record>

<record id="action_sale_order" model="ir.actions.report.xml">
    <field name="paperformat_id" ref="your_module_name.paperformat_sales"/>
</record>
Pranjal Gami
  • 214
  • 2
  • 15