1. Home
  2. Docs
  3. User Manual
  4. License Reporting
  5. Report Template

Report Template

Report Templates are required for reports that are scheduled with the ‘Delivery Format’ set to HTML. The template is an HTML document that contains markup tags which are parsed by the server and the generated output is sent via email.

The markup syntax is provided by the Django template language. Variable values can be identified by two curly braces {{ tag }}, while expressions are a single curly brace followed by a percentage sign {% do something %}.
For documentation on the capabilities for Django template, please refer to the project documentation page:

https://docs.djangoproject.com/en/1.11/ref/templates/language/#tags


The following variables are exposed to the Django template:

start_dateStart of the data sample in ISO format.
end_dateEnd of the data sample in ISO format.
tenant.nameThe name of the tenant object.
environment.nameThe name of the environment.
dataRaw data object.
data_jsData formatted to charts.js style for ease of use.
aggregated_dataRaw data aggregated for ease of use.
group_dataRaw business unit data.
group_data_jsBusiness unit data formatted to chart.js format.
group_aggregated_dataBusiness unit data in an aggregated format.

Rendering the chart elements can be achieved by a small amount of JavaScript coding and the use of libraries, such as Chart.js. Variables that end with _js are intended to be used within an HTML script tag to create a JavaScript variable.

For example:

{% autoescape off %}
<script language="JavaScript">
var data_js = {{data_js}};
var group_data_js = {{group_data_js}};
</script>
{% endautoescape %}

With the use of the JavaScript library JQuery, it is possible to generate a report that retrieves data from external sources to be included within the report.

Was this article helpful to you? Yes 1 No

How can we help?