Odoo Help


How to print a RML - PDF report with multiple page orientations?

on 8/2/13, 9:20 AM 3,482 views

I am trying to get multiple page orientation according to a generated XML definition with a pageTemplate that can take either the Landscape or Portrait value:


Then I pass the pageTemplate value in my_report.xsl file:

<xsl:template match="config"> <xsl:attribute name="firstPageTemplate"><xsl:value-of select="pageTemplate"/></xsl:attribute> ... </xsl:template>


<xsl:template match="product_template">
        <xsl:attribute name="name"><xsl:value-of select="//report/config/pageTemplate"/></xsl:attribute>
    <xsl:apply-templates select="data"/>        

With the different pageTemplate definitions in the custom_rml.xsl file:

<xsl:template name="rml">
    <document filename="example.pdf">
            <pageTemplate id="Landscape" pageSize="(29.7cm, 21cm)">
                <frame id="main" x1="0cm" y1="1cm" width="25.0cm" height="19cm"/>
            <pageTemplate id="Portrait" pageSize="(21cm, 29.7cm)" leftMargin="2.0cm" >
                <frame id="main" x1="2cm" y1="1cm" width="19.0cm" height="25cm"/>

The Frame definition works well according to the pageTemplate defined in the xml as portrait or landscape. However I still could not get the pageSize working properly. What could be wrong in the above code? I tried either pageSize and pagesize. Anyway both are working when placed directly in the template definition like: <template pageSize="(21cm, 29.7cm)"> but how to change this orientation from the xml definition? It may exist other-ways to do that... Any suggestions are welcome!

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 8/2/13, 9:20 AM
Seen: 3482 times
Last updated: 3/16/15, 8:10 AM