GitHub user dosubot[bot] added a comment to the discussion: Schedule exporting Execel
<!-- Greeting --> Hey @Abdel0U 👋, I'm here to help you with any bugs, questions, or contributions. Let's tackle this together! <!-- Answer --> I found some relevant discussions that might help you: 1. [Send as Excel for charts](https://github.com/apache/superset/discussions/31562) - This discussion is open and might provide insights into sending charts as Excel files. 2. [Add Excel (xlsx) attachment instead of CSV in Reporting](https://github.com/apache/superset/discussions/32026) - This is another open discussion that could be relevant to your needs. For your specific questions: 1. **Required Python Packages**: You need to have `pandas[excel]` and `xlsxwriter` installed to generate Excel files in Apache Superset. These are specified in the `pyproject.toml` file as follows: ```toml "pandas[excel]>=2.0.3, <2.1", "xlsxwriter>=3.0.7, <3.1", ``` <sup>[[1]](https://github.com/apache/superset/blob/master/pyproject.toml)</sup> 2. **Scheduling Reports**: You can configure scheduled reports in `superset_config.py` using the `CeleryConfig` class. Here is an example configuration: ```python class CeleryConfig: broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}" beat_schedule = { "reports.scheduler": { "task": "reports.scheduler", "schedule": crontab(minute=0, hour=8), # Schedule for 8:00 am }, } ``` Ensure that the `FEATURE_FLAGS` dictionary includes `"ALERT_REPORTS": True` to enable alert reports <sup>[[2]](https://github.com/apache/superset/discussions/31647)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/docker/pythonpath_dev/superset_config.py)</sup>. 3. **Automating Report Generation**: You can use `chart_id` or `dashboard_id` to automate report generation. The `ReportScheduleDAO` class provides methods like `find_by_chart_id` and `find_by_dashboard_id` to retrieve report schedules. You can also create new report schedules using the `CreateReportScheduleCommand` class <sup>[[4]](https://github.com/apache/superset/blob/master/superset/daos/report.py)</sup><sup>[[5]](https://github.com/apache/superset/blob/master/superset/commands/report/create.py)</sup>. These steps should help you set up scheduled email reports with XLSX attachments in Apache Superset. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fdf7907d-5f8c-4b82-be60-fcda8ac298a4?feedback_type=other)</sup> GitHub link: https://github.com/apache/superset/discussions/32843#discussioncomment-12614679 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
