How To Create Excel Reports

How to create Excel Reports, for many2one fields in different models of the same module??

There is no tool by default in Tryton to create Excel files but they are Python library that can be used for that openpyxl or XlsxWriter.
You can create a Report and override the execute method to return any binary content generated. You can find an example in ModelWorkflowGraph report.

Now, instead of using Excel format, you can use the generic CSV exporter of the client. It can define format that uses related values (like Many2One) up to any depths. An export format can be saved to be reused later.

1 Like

I want to export report from excel file sir. How it can be done.

So, you want to import data from an Excel spreadsheet into Tryton?

For simple data, you can save the spreadsheet as a CSV file and use the generic import functionality in the client.

If you are trying to import more complex information then you might want to look at creating a python script using proteus and the Python library metioned above:

Thank You Sir,
But I am not looking for importing of data from CSV to tryton
My query is how can I create a report in .csv format.
I have created reports in .PDF format earlier, looking to make similar reports in the .CSV format, too.

Sorry, I misunderstood you when you said

The original reply is what you are looking for then:

If you already has created report to create csv report is very easy: the csv file is a plain file.

<field name="template_extension">txt</field>
<field name="extension">csv</field>

But I thik taht the best option is ods format. :slight_smile:

Sir, using openxlsx csv file is generated but how to create it as pdf file and can be printed as an pdf file.

Make an ODS template using relatorio and configure the report to render as PDF.

Sir, are there any examples of ODS templates you can provide or are given in relatorio docs and source code?

There is an ODS example in the documentation.

1 Like

A post was split to a new topic: How to put text and value in relatorio ODS