Skip to main content
Share:
Link is copied

Next Generation Reports Configuration Examples

Customizing existing Next Generation report templates requires HTML and Angular JS knowledge. You can use code samples from the existing precofigured report templates as examples.

Below are some additional customization examples.

Remove Alarm IDs​

If your Alarm report includes dense data, you can remove some technical information that crowds the page and makes it visually confusing, for example, Alarm IDs.

To remove Alarm IDs:

  1. In the Template field of a report template you want to edit, locate the following code:

    Alarm ID  Code

  2. Delete it and save the template

Customizing branding elements, such as a logo, allows you to create similar report templates with different branding and send the same reports to different customers or contacts.

To customize a logo:

  1. In the Template field of a report template you want to edit, locate the following code:

    Report Template Logo Code

    In this code snippet, <logo height="42"></logo> determines that the logo in the report is taken from your tenant logo.

  2. Substitute the <logo height="42"></logo> snippet with an HTML link to a picture you want to use as a logo

    For example: <img height="42" src="[your_link]"/>

  3. Adjust the image height as desired

Creating an SQL Statement for Alarms Sorted by Types​

This is an example for an SQL statement which, when used in a new Data Source, returns a list of alarms counted and sorted by Alarm Type.

For example, it will show you, how many alarms of each type your selected site had during a specified period of time.

Use the following SQL statement:

select count (*), alarm_type from alarm where device_id ={{ device_id }} and timestamp > {{ start }} and timestamp < {{ end }} group by alarm_type

The figure below shows this SQL snippet used in creating a custom Data Source:

SQL Code Sample

Adding a Custom Data Source to a Report Template​

If you want to add a Custom Data Source to a Report Template, you can use this basic code:

<ng-container pdfDataSource="AlarmTypeCount"
[parameters]="{ deviceId: parameters.device_id, start:parameters.reportStart, end:parameters.reportEnd }"
#alarmTypeDataSource="pdfDataSource">
</ng-container>

<pre>{{ alarmTypeDataSource.data | json }} </pre>

The figure below shows this code in the Template field of a report template:

Adding a Custom Data Source

In this figure, a Data Source described in the section Creating and SQL Statement for Alarms Sorted by Types is used.

This code does not include formatting.

Organizing Data in a Table​

Once you add data to your report, you can format it the way you like and use various layouts.

This example shows you how to organize the data from the Data Source added in the section Adding a Custom Data Source to a Report Template in a table.

<div *ngFor="let alarmType of alarmTypeDataSource.data">
{{ alarmType.alarmType }}: {{alarmType.count }}
</div>

The figure below shows this code in the template field of a report template:

Arranging Data in a Table

Excluding Workflow Elements and Steps From a Report​

You can exclude specific workflow elements from a workflow report by using the excludedTypes array in the report template. Add the internal step names you want to skip, for example:

excludedTypes = [
'check-schedule',
'trigger-web-hook',
'execution-logs',
'trigger-alarm',
'send-email',
'generic'
];

Use the internal workflow element names exactly as defined in the system. For reference, the following step types can be used in excludedTypes:

excludedTypes = [
// Mixed steps
'close-workflow',
'do-nothing',
'loop-counter',
'pdf-step-report',
'trigger-alarm',

// Manual steps
'add-schedule-entry',
'call-contact-list',
'call-contact',
'call-v2-action',
'call-v2-decision',
'call-v2-common',
'form',
'generic',
'geutebrueck-view-cameras',
'jump',
'load-data-xls',
'run-command',
'run-shortcut',

// Automated steps
'ai-agent',
'alarm-close',
'alarm-message',
'alarm-send-to-ui',
'alarm-url',
'async-flow-branch',
'async-flow',
'check-condition',
'check-custom-field-case',
'check-custom-field',
'check-schedule',
'check-status',
'check-tag',
'create-job',
'match-alarm-case',
'match-alarm',
'mobile-verify-alarm',
'park-workflow',
'retrieve-alarms',
'send-dc09-command',
'send-sia-message',
'send-tna-command',
'send-to-monitoring-station',
'send-virtual-device-control-request',
'set-status',
'set-tag',
'switch-actor',
'time-of-day',
'trigger-web-hook',
'wait-for-alarm',
'wait-for-status'
];

Filtering Workflow Steps in the Report​

You can filter specific workflow steps out of a workflow report directly in the report template. To do this, add a filter function in the script block at the top of the template, then use that function in the *ngFor loop instead of iterating over context.completions directly.

Example you can add in a report template body:

<script>
context.filterSteps = function(completions) {
const excludedTypes = ['trigger-web-hook', 'trigger-alarm'];
return completions?.filter(completion => !excludedTypes.includes(completion.item.type));
}
</script>

Then replace:

<div *ngFor="let completion of context.completions; let i = index">

with:

<div *ngFor="let completion of filterSteps(context.completions); let i = index">

If your template contains a final step number based on the full completion list, update it as well so the numbering remains correct. Replace:

{{ workflow?.completions?.length + 1 }}

with:

{{ filterSteps(context.completions)?.length + 1 }}

You can define the steps to exclude in the excludedTypes array.

Was this page helpful?