OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.3 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ================
  5. Base report xlsx
  6. ================
  7. This module provides a basic report class to generate xlsx report.
  8. Installation
  9. ============
  10. Make sure you have ``xlsxwriter`` Python module installed::
  11. $ pip install xlsxwriter
  12. Usage
  13. =====
  14. An example of XLSX report for partners:
  15. A python class ::
  16. from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx
  17. class PartnerXlsx(ReportXlsx):
  18. def generate_xlsx_report(self, workbook, data, partners):
  19. for obj in partners:
  20. report_name = obj.name
  21. # One sheet by partner
  22. sheet = workbook.add_worksheet(report_name[:31])
  23. bold = workbook.add_format({'bold': True})
  24. sheet.write(0, 0, obj.name, bold)
  25. PartnerXlsx('report.res.partner.xlsx',
  26. 'res.partner')
  27. To manipulate the ``workbook`` and ``sheet`` objects, refer to the
  28. `documentation <http://xlsxwriter.readthedocs.org/>`_ of ``xlsxwriter``.
  29. A report XML record ::
  30. <report
  31. id="partner_xlsx"
  32. model="res.partner"
  33. string="Print to XLSX"
  34. report_type="xlsx"
  35. name="res.partner.xlsx"
  36. file="res.partner.xlsx"
  37. attachment_use="False"
  38. />
  39. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  40. :alt: Try me on Runbot
  41. :target: https://runbot.odoo-community.org/runbot/143/10.0
  42. Bug Tracker
  43. ===========
  44. Bugs are tracked on `GitHub Issues
  45. <https://github.com/OCA/reporting-engine/issues>`_. In case of trouble, please
  46. check there if your issue has already been reported. If you spotted it first,
  47. help us smashing it by providing a detailed and welcomed feedback.
  48. Credits
  49. =======
  50. Contributors
  51. ------------
  52. * Adrien Peiffer <adrien.peiffer@acsone.eu>
  53. Maintainer
  54. ----------
  55. .. image:: https://odoo-community.org/logo.png
  56. :alt: Odoo Community Association
  57. :target: https://odoo-community.org
  58. This module is maintained by the OCA.
  59. 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.
  60. To contribute to this module, please visit https://odoo-community.org.