Report Templates Overview

[add-on]

Report templates may be used to generate standardized PDF outputs for summarizing the information in a folder. Reports may include the signature of the user that generated them and are automatically saved in the folder where they are generated. Report templates provide a convenient mechanism for archiving and/or sharing study information in standard formats. Different report templates can be used for different studies, depending on the need.

Developing Templates

Developing templates requires understanding of HTML and CSS. If you don’t have the required expertise and are not willing to experiment, contact our support team for information on how we may be able to support you.

The style and layout of the data in a template can be fully customized with standard HTML and CSS, similar to how web pages are formatted. Additionally, placeholders can be used to represent metadata, snapshots, image thumbnails, hyperlinks, as well as other static data (e.g. text and images) throughout the template. During report generation, these placeholders are populated with data from the folder in which the report is generated. The output of the reporting engine is a PDF that has been formatted and populated according to the template that has been used.

To better understand the features of the templating language, start by reviewing our Jinja2 Quick Reference and Placeholder Reference. For comprehensive information about the templating language, refer to the Jinja2 documentation.

A Basic Template

The following example demonstrates a trivial example of a template that outputs the list of images in a folder. To learn more about the syntax and possibilities, see the following pages for more details: Jinja2 Quick Reference, Placeholder Reference and Auxiliary Information.

{# Section for report title #}
{% block title %}
{# Set the title of your PDF document in this block (text only) #}
{% endblock %}
{# Section for report body #}
{% block body %}
<div class="container">
<h1>Basic Report Template</h1>
<p>Set the content of your report within the "body" block.</p>
<p>Use variables passed to the template like this:</p>
<p>The name of the folder is {{ folder.name }}.</p>
<h2>List of Images</h2>
<ul>
{% for im in folder.images %}
<li>
{{ im.name }} ({{ im.filesize | filesizeformat }})
</li>
{% endfor %}
</ul>
<p>If the report is signed, the signer's signature and name will appear here:</p>
{% if report_signed_by %}
<div class="signature">
<img src="{{ report_signed_by.signature }}" />
<p>Signed by {{ report_signed_by.name }} at {{ report_signed_at }}</p>
</div>
{% endif %}
</div>
{% endblock %}