#1 2022-06-01 07:02:01

Johann
Member
Registered: 2022-05-30

How to convert Groovy MarkupBuilder output to CSV and send mail

I am able to execute an SQL query and display the results in a table (in HTML) using MarkupBuilder. However, I would like to also send an excel file of the results via email.

Could anyone share how this could be done?

Offline

#2 2022-06-01 08:52:28

eduardo
Administrator
Registered: 2016-11-01
Website

Re: How to convert Groovy MarkupBuilder output to CSV and send mail

Hi Johann,

why are you using MarkupBuilder to create the table, instead of using a simple dynamic list (based on your query), which has html export, and also excel export? this should be much easier to use. Any specific reason for doing this manually?

For creating excel files per script, you can use Apache POI. Here you have some example scripts: https://github.com/infofabrik/reportser … ools/excel

Regards,
Eduardo

Offline

#3 2022-06-01 09:35:56

Johann
Member
Registered: 2022-05-30

Re: How to convert Groovy MarkupBuilder output to CSV and send mail

Hi Eduardo,

I am relatively new to the code base as I have taken over a former employee. But from my understanding, the MarkupBuilder was used so that graphs of the same data could be shown to users. A workaround I am using is JXLS reports, which I am able to execute and schedule to send as an excel file (albeit without graphs).

Will take a look at dynamic lists and Apache POI, thank you!

Offline

Board footer

Powered by FluxBB