Reputation:
I have following code for qweb-pdf report its working fine but I wanted to add complete border to my page
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_feedback">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<h2>Feedback Report</h2>
<div class="row mt32 mb32">
<div class="col-xs-3" style="float:center;">
<strong>Substation:</strong>
<p t-field="o.company_id111.name"/>
<!--<strong>Maintainace ID:</strong>
<p t-field="o.folionum.number"/>
<strong>Folionum:</strong>
<p t-field="o.folio_number.folio_num"/>
<strong>Inspection Type :</strong>
<p t-field="o.inspec_type.inspection_name"/>-->
</div>
</div>
<!-- <div class="row mt64 mb64">
<div class="col-xs-6">
</div>
</div>-->
<div style="float:center">
<table border="1" class="table table-condensed" style="border-style:solid">
<thead>
<tr>
<th style="border: 1px solid black" class="text-center">Maintenance ID </th>
<th style="border: 1px solid black" class="text-center">Folio number </th>
<th style="border: 1px solid black" class="text-center">Inspection Type </th>
<th style="border: 1px solid black" class="text-center">Result </th>
<th style="border: 1px solid black" class="text-center">Values/Results </th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.insp_rslt" t-as="line"><td style="border: 1px solid black"><span t-field="line.folionum.number"/></td>
<td style="border: 1px solid black"><span t-field="line.folio_number.folio_num"/></td>
<td style="border: 1px solid black"><span t-field="line.inspec_type.inspection_name"/></td>
<td style="border: 1px solid black"><span t-field="line.insp_msr1.measure"/></td>
<td style="border: 1px solid black"><span t-field="line.valuess"/></td>
</tr>
</tbody>
</table>
</div>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>
feedback_report xml .I have tried with report.paperformat too but I am not able to add border to page .
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="action_report_feedback"
string="Feedback Report"
model="feedback.form"
report_type="qweb-pdf"
name="feedback_form.report_feedback"
file="feedback_form.report_feedback"
/>
<record id="paperformat_lowmargin" model="report.paperformat">
<field name="name">European A4 low margin</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">4</field>
<field name="margin_bottom">4</field>
<field name="margin_left">4</field>
<field name="margin_right">4</field>
<field name="header_line" eval="False" />
<field name="header_spacing">4</field>
<field name="dpi">90</field>
</record>
<record id="feedback_form.action_report_feedback" model="ir.actions.report.xml">
<field name="paperformat_id" ref="feedback_form.paperformat_lowmargin" />
</record>
Upvotes: 3
Views: 11232
Reputation: 663
I tried this and it works fine to add full page border to pdf report
<t t-call="web.basic_layout">
<!-- Full Report Border -->
<div class="page" style="border: 2px solid black; padding: 20px; height: 33cm; width: 22.5cm; box-sizing: border-box; margin: 0; padding-bottom: 0;">
</div>
</t>
Upvotes: 0
Reputation: 1531
You need to use border with div tag like this outside page class in layouts.xml file found in reports module
<div style="border: 1px solid black;">
<div class = "page"></div>
</div>
Upvotes: 2
Reputation: 704
<table class="table table-bordered">
you can add ur custome css for page class.
<div class="page">
Upvotes: 0