Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am trying to get multiple page orientation according to a generated XML definition with a pageTemplate that can take either the
<report> <config> <pageTemplate>Landscape</pageTemplate> ...
Then I pass the
pageTemplate value in
<xsl:template match="config"> <xsl:attribute name="firstPageTemplate"><xsl:value-of select="pageTemplate"/></xsl:attribute> ... </xsl:template>
<xsl:template match="product_template"> <setNextTemplate> <xsl:attribute name="name"><xsl:value-of select="//report/config/pageTemplate"/></xsl:attribute> </setNextTemplate> <xsl:apply-templates select="data"/> </xsl:template>
With the different pageTemplate definitions in the
<xsl:template name="rml"> <document filename="example.pdf"> <template> <pageTemplate id="Landscape" pageSize="(29.7cm, 21cm)"> <frame id="main" x1="0cm" y1="1cm" width="25.0cm" height="19cm"/> </pageTemplate> <pageTemplate id="Portrait" pageSize="(21cm, 29.7cm)" leftMargin="2.0cm" > <frame id="main" x1="2cm" y1="1cm" width="19.0cm" height="25cm"/> </pageTemplate> </template> ...
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!
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 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/2/13, 9:20 AM|
|Seen: 2731 times|
|Last updated: 3/16/15, 8:10 AM|