Convert to csv issue

Hi everyone,
I’m trying to export a report to csv.
Even though the extension is set to csv in the xml config file, the exported file has the txt extension (template_extension).

<record model="" id="tariffs_report">
	<field name="name">Tariffs Report</field>
	<field name="model">transport.tariffs_report_line</field>
        <field name="report_name">transport.tariffs_report</field>
        <field name="report">transport/tariffs.txt</field>
        <field name="template_extension">txt</field>
        <field name="extension">csv</field>
        <field name="translatable" eval="False"/>

In the docker log for my container I noticed this error :

javaldx: Could not find a Java Runtime Environment!

Please ensure that a JVM and the package libreoffice-java-common is installed.

If it is already installed then try removing ~/.config/libreoffice/4/user/config/javasettingsLinux*.xml

Warning: failed to read path from javaldx

Error: no export filter for /tmp/trytondlm4cez5/transport.tariffs_report.csv found, aborting.

Error: no export filter

[Wed Mar 16 13:29:11 2022] to convert transport.tariffs_report to csv

After adding this to my dockerfile (I’m using FROM tryton/tryton:6.2-office) :
RUN apt install -y default-jdk
RUN apt install -y libreoffice-java-common

I still have the errors :

Error: no export filter for /tmp/trytondlm4cez5/transport.tariffs_report.csv found, aborting.

Error: no export filter

Am I missing something ?

It looks like LibreOffice can not convert your text file into CSV. As far as I understand LibreOffice can only export Spreadsheet to CSV.

Now I do not think it is a good practice to use relatorio to generate CSV file. It is probably better to write a wizard to create the file using the Python csv module like

Hi @ced,

I have looked at and I was able to use the csv module to export my file. I agree this is a better practice to do it this way instead of using a report.

Thanks for your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.