Createreport¶
flowtask.components.CreateReport.CreateReport
¶
CreateReport.
Using a Jinja2 Template to crete a Report and, optionally, send via Email.
Example:
```yaml
CreateReport:
template_file: echelon_program_overview_raw.html
create_pdf: true
masks:
'{today}':
- today
- mask: '%m/%d/%Y'
'{created}':
- today
- mask: '%Y-%m-%d %H:%M:%s'
'{firstdate}':
- date_diff
- value: today
diff: 8
mode: days
mask: '%b %d, %Y'
'{lastdate}':
- yesterday
- mask: '%b %d, %Y'
send:
via: email
list: echelon_program_overview
message:
subject: 'Echelon Kohl''s VIBA Report for: ({today})'
arguments:
today_report: '{today}'
generated_at: '{created}'
firstdate: '{firstdate}'
lastdate: '{lastdate}'
```
CreateReport
¶
Bases: FlowComponent, DBSupport
CreateReport
Overview
The CreateReport class is a component for creating rich reports and sending them via the Notify service. It uses
template handling and chart creation to generate the content of the reports and sends them to a list of recipients.
.. table:: Properties :widths: auto
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| Name | Required | Description |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| _data | Yes | A dictionary containing the input data for the report. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| _parser | Yes | The template parser for generating the report content. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| _chartparser | Yes | The template parser for generating charts. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| template_file | Yes | The file name of the template to use for the report. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| recipients | Yes | A list of recipients to send the report to. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| send | Yes | A dictionary containing the sending options and configurations. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
| message | No | The message content for the report. |
+------------------+----------+-----------+--------------------------------------------------------------------------------------+
Returns:
The input data after sending the report.