mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_xlsx - Pass the report instance as well as ids of records to print to the 'create_xlsx_report' method + Instanciate the parser and make it available for the 'generate_xlsx_report' method
This commit is contained in:
@@ -8,6 +8,13 @@ Base report xlsx
|
||||
|
||||
This module provides a basic report class to generate xlsx report.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Make sure you have ``xlsxwriter`` Python module installed::
|
||||
|
||||
$ pip install xlsxwriter
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
@@ -17,7 +24,7 @@ A python class ::
|
||||
|
||||
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
|
||||
|
||||
class partner_xlsx(ReportXlsx):
|
||||
class PartnerXlsx(ReportXlsx):
|
||||
|
||||
def generate_xlsx_report(self, workbook, data, partners):
|
||||
for obj in partners:
|
||||
@@ -28,8 +35,11 @@ A python class ::
|
||||
sheet.write(0, 0, obj.name, bold)
|
||||
|
||||
|
||||
partner_xlsx('report.res.partner.xlsx',
|
||||
'res.partner')
|
||||
PartnerXlsx('report.res.partner.xlsx',
|
||||
'res.partner')
|
||||
|
||||
To manipulate the ``workbook`` and ``sheet`` objects, refer to the
|
||||
`documentation <http://xlsxwriter.readthedocs.org/>`_ of ``xlsxwriter``.
|
||||
|
||||
A report XML record ::
|
||||
|
||||
@@ -74,4 +84,4 @@ This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
|
||||
Reference in New Issue
Block a user