Report Templates

Developer guide for the Enezaframework reporting engine. Part of the Add Report series.

Table of Contents

  1. Overview
  2. Rendering Path
  3. Template Blocks
  4. Overriding Partials
  5. Template Tags
  6. Related Guides

Overview

All engine reports render through a shared layout, so you only write templates when a report needs presentation the generic layout cannot provide. Reports default to eneza_reporting/report.html (enezareporting/views.py).


Rendering Path

flowchart LR
    BASE["eneza_reporting/base.html<br/>toolbar, sidebar, A4 page"] --> REPORT["eneza_reporting/report.html<br/>unified report layout"]
    REPORT --> DOC["document_report.html<br/>DocumentReport block"]
    REPORT --> DD["drilldown_report.html<br/>DrillDownReport block"]
    REPORT --> STD["default content block<br/>Tabular / Crosstab / TimeSeries"]

The unified layout provides:

  • A top toolbar (zoom, print, export, theme toggle).
  • A left sidebar (export options, document info / data stats).
  • An A4 page content area with a dark surround.

Template Blocks

Block Used by
document_report_content DocumentReportView — header grid + lines table + totals.
drilldown_report_content DrillDownReportView — breadcrumb + drill-down table.
content (default) TabularReportView / CrosstabReportView / TimeSeriesReportView — standard data table.

Overriding Partials

Override these templates in your project to customize appearance:

Template Purpose
eneza_reporting/print_report_header.html Header with company name, date range, document reference.
eneza_reporting/print_report_footer.html Footer with the confidentiality notice.
eneza_reporting/document_report.html Document report content block.
eneza_reporting/drilldown_report.html Drill-down report content block.
eneza_reporting/leftsidebar.html Sidebar with export actions and info.

Other shipped partials include report_form.html (filter form), report_filter_modal.html (modal filter), report_results.html, widget_template.html, and design_report.html (designer output).


Template Tags

djangotemplate
{% load eneza_reporting_tags %}

{# Render a report widget by URL name #}
{% get_widget_from_url url_name="my_report" title="Sales" %}

{# Get a dict value by key #}
{{ my_dict|get_item:"key_name" }}

{# Get a list from a QueryDict #}
{{ request.GET|get_list:"path" }}

Available tags and filters in enezareporting/templatetags/eneza_reporting_tags.py:

Tag / filter Purpose
get_widget_from_url Resolve a URL name and render a report widget.
get_widget Render a report widget from a report class.
get_charts_media Collect chart engine media for the configured charts.
get_slick_reporting_media Collect the configured JS/CSS media.
get_slick_reporting_settings Expose the effective reporting settings.
add_jquery Emit the configured jQuery script tag.
get_item Look up a dictionary value by key.
get_list Return a list value from a QueryDict.