Auxiliary Information


Styles

Report templates in PathcoreFlow use Cascading Style Sheets (CSS) to style the generated reports. More information about the supported CSS specifications can be found in the WeasyPrint documentation

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 adding it to the Static Data tab. Data entered there can be accessed inside the template via the variable static_data. The data is specified using the JavaScript Object Notation (JSON) format. See this introduction to JSON syntax for more information.

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 'foo' #}
{% for item in static_data['foo'] %}
{# Outputs each item in the 'foo' array #}
<li>{{ item }}</li>
{% endfor %}
</ul>
{# Outputs string variables 'name' and 'date' from static_data #}
<p>
Name: {{ static_data['name'] }} <br>
Date: {{ static_data['date'] }}
</p>

This section shows the Static Data values in JSON format.

{
"foo": [
"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.

To create a snapshot container
  1. Open a report template for editing. See Working With Reports for details

  2. Click on the Snapshots tab

  3. Click on the + Add Snapshot Container button

  4. Type a name for the container in the Display Name field

  5. Type a value in the Template Name field

    • This is the name of the snapshot container used within the report template. For example, if you name the container "selected_features", the list of snapshots would be accessed as the variable snapshots.selected_features
  6. (Optional) Enable the Required toggle if the report must contain snapshots

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

To delete a snapshot container
  1. Open a report template for editing. See Working With Reports for details

  2. Click on the Snapshots tab

  3. Locate the container to be removed

  4. Click on the Delete Container button at the bottom left of the container block

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 #}
<div>
<p>Title: {{ snapshot.title }}</p>
<p>ID: {{ snapshot.id }}</p>
<p>Description: {{ snapshot.description }}</p>
{# Displays the snapshot #}
<img src="{{ snapshot.get_region(bounds=[300,300]) }}" />
</div>
{% endfor %}