Auxiliary Information

Report styles

The report template in PathcoreFlow uses Cascading Style Sheets or CSS to style the generated reports. More information about the supported CSS specifications can be found here:

https://doc.courtbouillon.org/weasyprint/stable/api_reference.html#css.

Style Example

This example CSS style will set the font to sans-serif for the container class, sets the max width to 3 inches and text aligned to center for the signature class, sets the max width of an image in the signature class to 100%, and creates a border around any images.

/* Define your CSS styles here */
.container {
font-family: sans-serif;
}
.signature {
max-width: 3in;
text-align: center;
}
.signature img {
max-width: 100%;
}
img {
border-style: solid;
}

Static data

Predefined data can be added to a report in a flexible way by using the Static Data tab. Data entered there can be accessed inside the template as the variable static_data. The data is specified using the JavaScript Object Notation (JSON) format. See the link below for an introduction to the JSON format: https://www.w3schools.com/js/js_json_syntax.asp.

Static Data Example

This section shows the report template code to display output from static_data.

<h2>
Static Data
</h2>
<ul>
{# Begins looping through the static data array called 'todo' #}
{% for item in static_data['todo'] %}
{# Outputs each item in the 'todo' array #}
<li> {{ item }}</li>
{% endfor %}
{# Outputs string variables 'name' and 'date' from static_data #}
<p>
Name: {{ static_data['name'] }} <br>
Date: {{ static_data['date'] }}
</p>
</ul>

This section shows the Static Data values in JSON format.

{
"todo": [
"define",
"your",
"static",
"data",
"here"
],
"name": "value",
"date": "2020-08-18"
}

Snapshots

Snapshots can be displayed alongside their associated image or on their own within a report. If the desire is to only display snapshots, a snapshot container needs to be created within the Report Template. A snapshot container is an array of selected snapshots from the report folder.

  1. On the Snapshots tab under Report Template, click Add Snapshot Container

  2. Enter a Display Name for the snapshot container.

  3. Enter a Template Name.*

  4. Set the Required toggle if the report must contain snapshots

  5. Set between to the range of snapshots allowed/required in the report. (i.e. to force the user to select up to 5 snapshots to be included in the report, set between to 1 and 5)

*This is the name of the snapshots container used inside the report template. That is, if you name the container selected_features, the list of snapshots can be accessed as the variable snapshots.selected_features.

Snapshots Example

{# Begins looping through all the snapshots in the snapshot container 'container1' #}
{% for snapshot in snapshots['container1'] %}
{# Displays the title, id and description of each snapshot #}
<ul>
<li>Title: {{ snapshot.title }}</li>
<li>ID: {{ snapshot.id }} </li>
<li>Description: {{ snapshot.description }}</li>
{# Displays the snapshot #}
<img src="{{ snapshot.get_region(bounds=[300,300]) }}" />
</ul><br>
{% endfor %}