Add Excel (xlsx) attachment instead of CSV in Reporting #32026
Replies: 1 comment 2 replies
-
To send XLSX attachments instead of CSV in the reporting feature of Superset, you can modify the backend code as follows:
These changes should allow you to send XLSX attachments instead of CSV without modifying the frontend. Make sure to test these changes thoroughly to ensure they work as expected. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
I've seen a PR #19810 to enable Excel attachments in Alerts & Reportings.
It's not implemented yet, and Excel attachments are needed now :)
I don't have access to the frontend part, can only change the backend.
So the idea is to keep the same UI (options to attach Text or PNG or PDF or CSV) but 'inject' another code that attaches XLSX instead of CSV.
So I am curious how to send XLSX instead of CSV.
If I got it correct, 4 files must be changed:
and a function
df_to_excel
from/superset/utils/excel.py
must be used.@dosu, please help. Provide snippets of code for each file (models.py, email.py, base.py. execute.py). This list maybe incomplete, do not limit yourself with only those files.
The snippets should have a complete code that allows sending
xlsx
instead ofcsv
without changing the frontend part.Superset version: 4.1.1, installed on Linux CentOS.
Beta Was this translation helpful? Give feedback.
All reactions