openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #00531
Re: let the user choose different styles for a report
Hi Martin,
Problem I found is that there is not an easy way to get a landscape
header (there is by default only one company header).
For this, I created a small module to have different header you can use
here:
http://apps.openerp.com/addon/5722?filter={%22order_by%22%3A+%22click_counter+desc%22%2C+%22text_search%22%3A+%22elico%22}&page=0
then you should declare 4 different reports.
eg
report_sxw.report_sxw('report.product.pricelist1','product.product','addons/product/report/product_pricelist1.rml',parser=product_pricelist, header="header1")
report_sxw.report_sxw('report.product.pricelist2','product.product','addons/product/report/product_pricelist2.rml',parser=product_pricelist, header="header2")
report_sxw.report_sxw('report.product.pricelist3','product.product','addons/product/report/product_pricelist3.rml',parser=product_pricelist, header="header3")
report_sxw.report_sxw('report.product.pricelist4','product.product','addons/product/report/product_pricelist4.rml',parser=product_pricelist, header="header4")
If you use my header modules or dont declare headers if the company one is enough.
You need to create the corresponding actions
You can take exemple from here for a simple module adding a report to another module:
http://apps.openerp.com/addon/5864?filter={%22order_by%22%3A+%22click_counter+desc%22%2C+%22text_search%22%3A+%22elico%22}&page=0
Best regards
Eric CAUDAL
eric.caudal@xxxxxxxxxxxxxx <mailto:caudaleric@xxxxxxxxxxxxxx>
Cell phone: + 86 186 2136 1670
Elico Corp, Shanghai
OpenERP Ready Partner
http://www.elico-corp.com
On 31/08/2011 18:57, Martin Herweg wrote:
Hello!
thank you for your fast and friendly help so far!
I'd like to make 4 similar RML/sxw reports:
The parser like for example:
/addons/product/report/product_pricelist.py
should be always the same, but with 4 different .rml to choose from:
Users's choice of HTML/PDF& Landscape/Portrait
So instead of the static path to the rml
it should be filled with a variable:
report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
any ideas/suggestions ?
maybe someone did this in another module already?
have a niche day!
Martin
_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to : openerp-community@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~openerp-community
More help : https://help.launchpad.net/ListHelp
References