Announcement

Migration of this forum

Dear users of this forum,

we are pleased to inform you that we will be updating the software behind this forum in the near future.

Existing posts, users and categories will remain untouched.

Important:

  • Each user will need to reset their password.
  • Please select "I forgot my password".
  • Enter the email address you used to register in this forum.
  • You will receive an email with a link to set a new password.
  • Please choose a new (secure) password and confirm the process.

We will keep you informed in the pinned thread.

Kind regards,
Your ReportServer Team


Migration des Forums

Liebe Nutzer dieses Forums,

wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.

Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!

Wichtig:

  • Jeder Nutzer muss sein Passwort neu vergeben.
  • Wählt dazu einfach "Ich habe mein Passwort vergessen".
  • Gebt die E-Mail-Adresse ein, mit der ihr registriert seid.
  • Ihr erhaltet eine E-Mail mit einem Link zur Passwortvergabe.
  • Bitte wählt ein neues (sicheres) Passwort und bestätigt den Vorgang.

Wir halten euch im angepinnten Beitrag auf dem Laufenden!

Mit vielen Grüßen
Euer ReportServer Team

#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

IF_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