Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 547
César Avatar asked Oct 29 '14 19:10

César


People also ask

How do I change the space between header and text?

Right-click the Heading Style and then select the Modify option. At the bottom of the Modify Style dialog there will be a button that says Modify, click this button. Select the Paragraph option. Within the Paragraph dialog change the option for Spacing, After to be a lower number.


1 Answers

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

like image 71
Paulo Farinha Silva Avatar answered Sep 19 '22 19:09

Paulo Farinha Silva