콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
8263 화면

I would like to place an image in QWEB report that stretches right to the ends of the page on both sides . I tried setting Left and Right page margins to 0 in the Paper Format, but even then there is a small white space left on either side. Does any one know how this can be done?

아바타
취소
베스트 답변

For that you need to extend the report layout minimal_layout to control when the report body needs the container class or not, because that is the responsible for that issue or requirement that you have. You could do something like this:

<template id="custom_minimal_layout" inherit_id="report.minimal_layout">

<xpath="//body" position="replace">

<t t-set="need_container" t-value="False"/>

<body class="container" onload="subst()" t-if="need_container">

<t t-raw="body"/>

</body>

<body onload="subst()" t-if="not need_container">

<t t-raw="body"/>

</body>

</xpath>

</template>

Make sure to provide a valid condition to set the need_container var a True/False value when it's a normal report that need the container class or not. This was an example, you could do the same with t-attf-class and related but it's less clear for the example. The template "report.minimal_layout"  is directly used by  the report model get_html method. 

 

아바타
취소
작성자

This is great, thanks Axel. But could you please tell me a little bit more about the condition i.e. what condition to use to dynamically set it as True / False depending on the report?

Is there any possibility to do only for header. we do need container for body

관련 게시물 답글 화면 활동
2
10월 22
6704
Sum on QWeb reports 해결 완료
3
3월 21
44230
1
9월 16
4259
0
12월 15
4598
1
6월 15
10208