How can I remove the space between header and body in PDF report?

César picture César · Oct 29, 2014 · Viewed 9.7k times · Source

I've customized my sales report to look from this:


enter image description here


To this:


enter image description here


I commented the code section that shows the company information inside external_layout_header view:

<?xml version="1.0"?>
<t t-name="report.external_layout_header">
    <div class="header">
        <div class="row">
            <div class="col-xs-3">
                <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
            </div>
            <div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
        </div>
        <div class="row zero_min_height">
            <div class="col-xs-12">
                <div style="border-bottom: 1px solid black;"/>
            </div>
        </div>
<!-- COMMENTED
        <div class="row">
            <div class="col-xs-3">
                <div t-field="company.partner_id" t-field-options="{'widget': 'contact', 'fields': ['address', 'name'], 'no_marker': true}" style="border-bottom: 1px solid black;"/>
            </div>
        </div>
-->
    </div>
</t>

Somehow, I was expecting to reduce the space between the header and the report body. I've been trying out different ways with no luck. There's a similar question in the Odoo forum but that's for v7 with RML (deprecated). I'm using Odoo v8 QWeb report.

Edit 1:

I already tried @Paulo's solution:


enter image description here


But this is not what I'm looking for. I need to gain space by moving the body near the header and not the other way around

Edit 2 (Solution):

As suggested by @Paulo's comment, playing around with the combination of fields margin_top and header_spacing did the trick. I reduced margin_top from 40 to 20 and header_spacing from 35 to 15.

Answer

Paulo Farinha Silva picture Paulo Farinha Silva · Oct 31, 2014

The solution is on the Paper Format: in my case A4.

You have to go to Settings > Technical > Reports > Paper Format > A4 and decrease the Header spacing value