Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Can Frame boundaries be changed in SXW-RML reports?

By
Aitzol
on 5/16/13, 8:36 AM 4,402 views

I am trying to create a new SXW RML report in landscape format. I have been able to convert the RML to A4 landscape mode but I have some issues with a tables and page breaks.

I'd like the report to display 4 tables, all of them in one page. This is the draft of the report I am designing:

Image: www.solid-rock-it.com/web-solid-rock/blog/images/OpenERP/Captura.PNG

I would like the Table3 and Table4 to be rendered lower than in the draft. But the problem is that if I add a new line before the Table3 or Table4, the RML conversion creates a new page break, and the tables are rendered in a second page.

I think the problem has something to do with the frame size and its boundaries. As it can be seen in the previous image in which the boundaries are displayed, the bondaries are configured as if the page was in portrait mode instead of landscape. How can I change the boundaries to adapt them to landscape mode?

RML file:

<?xml version="1.0"?>
<document filename="test.pdf">
  <template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" showBoundary="1" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="57.0" y1="57.0" width="728" height="481"/>
    </pageTemplate>
  </template>

Thanks,

Hi Aitzol, can you please tell me which OpenERP version you are using? Make sure you are upto latest updates. Thanks

Keyur
on 5/20/13, 6:52 AM

I am using openerp 6.1.1. Fortunately, I have been able to find a solution to the problem

Aitzol
on 7/11/13, 8:27 AM
1

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 5/16/13, 9:36 AM

Hi Aitzol, tables are not displayed properly because the report is A4 size in portrait. You just need to convert portrait document in landscape mode then it will be in proper order. First open your sxw file in there go to Format->Page menu there you can see Orientation:Landscape.

image description

You can also set page size from rml. Generally template pagesize is (842,595) for landscape report. You can also change in frame tag as per your need.

  <template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="35.0" y1="35.0" width="772" height="525"/>
       <header>
                //Your Company header
      </header>      
    </pageTemplate>
  </template>

Thanks Keyur, The SXW report is already in landscape mode and the page layout in the PDF is a A4 in landscape format, as my previous image shows (notice the right margin). The problem is that the page boundaries remain as if it was in portrait mode.

Aitzol
on 5/16/13, 9:52 AM

The strangest thing is that the template's and frame's sizes are already configured for landscape mode. The boundaries however, remain to be in portrait mode. This is the RML:

<?xml version="1.0"?> <document filename="test.pdf"> <template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" showBoundary="1" allowSplitting="20"> <pageTemplate id="first"> <frame id="first" x1="57.0" y1="57.0" width="728" height="481"/> </pageTemplate> </template>

Image of the PDF, still with wrong boundaries: http://www.solid-rock-it.com/web-solid-rock/blog/images/OpenERP/Captura2.PNG

Aitzol
on 5/20/13, 6:16 AM

Maybe because you are printing barcode report so that's why the report is not in actual width try to reduce the width of the barcode table then it might help. Thanks

Keyur
on 5/20/13, 6:54 AM
0
Aitzol
On 7/11/13, 8:15 AM

I finally found the solution to the problem with the page landscape layout. The problem was that although the page was in landscape mode, the page frame remained in portrait mode.

I found that all dimensions in the rml were ok and the problem was somewhere else, in the report's python file to be precise:

report_sxw.report_sxw('report.modulename.product.label','mrp.production','addons/modulename/report/product_label.rml',parser=order,header=False)

The problem has been solved by adding "header=False" parameter to the report_sxw method call. It seems that by not adding this parameter, OpenERP modifies the page layout in order to add the header, which is configured to be in portrait mode. This was overwriting the settings for landscape mode in my RML file.

I have the same problem, I have OpenERP Online, do you know where can I find this file? Thanks

Luis Lozano
on 12/24/13, 2:16 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 5/16/13, 8:36 AM
Seen: 4402 times
Last updated: 3/16/15, 8:10 AM