Introduction
(Since 2024.02)
Dynamic Report Display can be configured through the configuration of a Dynamic Report Display in the DynamicReportDisplays.xml in combination with an appropriate report template in the ReportTemplatesFiles. The main design principle has been that - more than with the ReportModule - data and format of the data have been separated. Such that:
- DynamicReportDisplays.xml: controls/defines the data (through dataobjects) that are passed to the html template.
- The .html template in the ReportTemplateFiles: defines the way the data is presented in the display.
The Dynamic Report Module has been designed with - as the name indicated - dynamically generating data and subsequently displays at its core. Therefore, we have chosen to incorporate Thymeleaf. Thymeleaf is a Java template engine that’s often used with Spring Boot to create dynamic web applications. Some advantages of Thymeleaf:
It lets you write normal HTML files and add dynamic parts using special attributes like
th:text,th:each, etc.Templates are valid HTML, so you can open them directly in a browser (good for frontend designers).
It supports loops, conditions, formatting, fragments (reusable pieces of HTML), and easy integration with backend data.
You can pass data objects to the template.
The Dynamic Report is on-the-fly generated and not produced by a workflow. And has therefore not the characteristics of a report generated in workflow has, such as a T0. Because the reports are generated on the fly, it is possible to have time dependent displays. An example will be provided.
Dynamic Report Display Configuration
Loops & selected time interaction
Loop over timeSerieSets: <loopTimeSeriesSetVariable id="VAR" timeSeriesSetsId="alert_levels"/>
Loop over locations: <loopLocationVariable id="LOC" locationSetId="control_management_type"/>
Time dependent Reports: <selectedTimeVariable id="TIME">
By configuring the <selectedTimeVariable> element the dynamic report can be made time dependent. You can configure a timestep and relative view period. This allows for time dependent functions to be called. (e.g. Value and IndexValue)
Code example with all loops and the selectedTimeVariable
Dynamic Report Template
A .html template must be placed in the ReportTemplateFiles.