Report Templates

Monolith allows you to make use of report templates, so you can create any reports you wish based on data within a Monolith case.

Template Document

The template document must be a Microsoft Word document (DOCX).

Template Syntax

In order to use a template, you must insert placeholders that Monolith recognizes as case variables that can be replaced with case data:

Be mindful of the placement of spaces within the template syntax - spaces matter.

Standard Variable:

Here is standard syntax for inserting basic values into a template -

{{ variable }}

Ex: {{ case.case_number }}

Please ensure that there is a space at the start and end of the variable name.

At the time of report generation, Monolith will replace this template variable with the chosen data from the case:

// Example Template Data in docx file
This case was issued case number "{{ case.case_number }}".

// Resulting document data in generated report
THis case was issued case number "MF-22-1985".

Lists and Loops

Some data in a Monolith case consists of a list of items. For example, you may want to reference data from evidence items associated with a case. You may have ten evidence items in a case and you want that evidence data to be included in your templated report.

To do this, we need to use some special syntax to loop through the list of evidence items and output each item's data into the template report.

Here is the basic syntax to loop through a list of items in a template document:

{% for item in evidence %}
{{ item.evidence_number }}
{% endfor %}

The above syntax will loop through a list of evidence items (stored in the "evidence" variable} and output a vertical list of evidence numbers.

// Here is a basic evidence list variable example:
// evidence = [{evidence_number: "1234"}, {evidence_number: "45689"}]

Example 1: Vertical list of evidence numbers - 

// template syntax for a loop
{% for item in evidence %}
{{ item.evidence_number }}
{% endfor %}

// The above syntax will result in the following document output:
1234
45689

Example 2: Horizontal list of evidence numbers - 
// template syntax for a loop
{% for item in evidence %}{{ item.evidence_number }} {% endfor %}

// The above syntax will result in the following document output:
1234 45689

Loops are a very powerful way to create complex report templates and display just about any data that you want.

Table Rows

There is special syntax used to iterate through table rows - similar to the looping syntax above, you may want to iterate through a list and create table rows with data.

Lets create a table that contains rows for each evidence item and columns for the evidence number and evidence provider (manufacturer, make, etc...)

Given the following evidence data passed to the template from a case:

[
    {
        evidence_number: "1234", 
        manufacturer: "Apple"
    },
    {
        evidence_number: "45689", 
        manufacturer: "Dell"
    }
]

Template Syntax for table -

Generated Document Result -

The "tr" prefix denotes that we are creating a loop through table rows.

You'll notice that the table rows that have the start loop syntax and end loop syntax are not included in the final rendered table.

Using this syntax you can create tables with templated lists pulled in from Monolith.

Other Template Syntax

There is more syntax available for templates, but the item listed about are the most common. If you need help with this or have more questions, reach out to us at support@monolithforensics.com.

Last updated