Report Mixin
ReportMixin¶
The ReportMixin class provides a plugin with the ability to extend the functionality of custom report templates. A plugin which implements the ReportMixin mixin class can add custom context data to a report template for rendering.
Add Report Context¶
A plugin which implements the ReportMixin mixin can define the add_report_context
method, allowing custom context data to be added to a report template at time of printing.
Add Label Context¶
Additionally the add_label_context
method, allowing custom context data to be added to a label template at time of printing.
Sample Plugin¶
A sample plugin which provides additional context data to the report templates is available:
Sample plugin which provides extra context data to a report.
Source code in src/backend/InvenTree/plugin/samples/integration/report_plugin_sample.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|