class CustomExportReport(GroupByReport):
report_title = _("Custom Export Report")
report_description = _("Demonstrates adding custom action (here export_pdf) action alongside the built-ins"
"Also shows how to customize buttons label and css class")
export_actions = ["export_pdf"]
def export_pdf(self, report_data):
return HttpResponse(f"Dummy PDF Exported \n {report_data}")
export_pdf.title = _("Export PDF") # The label for the export action button
export_pdf.css_class = "btn btn-secondary" # the button classes
def export_csv(self, report_data):
return super().export_csv(report_data)
export_csv.title = _("My Custom CSV export Title")
export_csv.css_class = "btn btn-primary"