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:
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?
<?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>
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
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>
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:
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.
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
|Asked: 5/16/13, 8:36 AM|
|Seen: 4402 times|
|Last updated: 3/16/15, 8:10 AM|