Customizing Reporting Templates

<< Click to Display Table of Contents >>

PackBench > 7.3 u1 > User Guide > Advanced Topics 

Customizing Reporting Templates

Basics

Report files created by PackBench are customizable. Depending on the configuration, there is either a physical or a binary content stored in the database which represents the template file for each report template configured per project. The chapter Reports describes how to edit existing templates and how to save and update them. This chapter contains information about how to actually customize or even create documents from scratch, so that they can be used as report templates.

Prerequisites

The templates are stored as Microsoft Word® .docx format. In order to edit or create them, Microsoft Word® or a third-party software capable of opening and saving.docx files is required.

 

tip

Tip:

It is recommended to start by making a copy of a default template and not to start from scratch.

 

Default Template

The default template is located in the following location:

 

<INSTALLDIR>\Resources\Reports\DefaultTemplate.docx

 

Unless there are no other settings for a project (see the picture below), this file is used as a report template.

 

report_01

 

For example, a simple table containing base run properties can be defined using the following placeholders:

 

report template

 

Using Table Templates

PackBench scans the content of the template and looks for the presence of tables which have one of the following alternative texts:

 

(#Table.Tasks)

(#Table.Variables)

 

They both have a special meaning. Instead of printing the table as it is, the content of the table is repeated for each element - task and variable respectively - available within the current run.

 

In order to see or change the alternative text, select a table and from its context menu options select Properties. The alternative text can be changed by adjusting the Title field in Alt Text tab.

 

93

 

Tasks Table

A table which contains alternative text (#Table.Tasks) is considered to be a tasks table. Its rows are repeated for each task present in the run. If there are no tasks, the table is not shown.

Within the table, the following placeholders can be used:

 

(#Subtasks)
When used inside the tasks table, it inserts a list of subtasks in the place where the placeholder occurs. It is recommended to reserve an empty row for this tag, as the content of the tasks table will be repeated here.
 

(#Name)
When used inside the tasks table, it represents the name of the task.
 

(#Note)
When used inside the tasks table, it represents the description of the task.
 

(#HelpText)
When used inside the tasks table, it represents an additional help for the task.
 

(#ToolName)
When used inside the tasks table, it represents the name of the tool assigned to the task.
 

(#Status)
When used inside the tasks table, it represents a human-readable status of the task. For a colored version, use (#coloredstatus).
 

(#ColoredStatus)
When used inside the tasks table, it represents a human-readable status of the task. The text has a foreground which depends on the status: green for finished tasks, yellow for open tasks, gray for skipped tasks.
 

(#Comment)
When used inside the tasks table, it represents comments (if present) added to the task.

 

Custom Variables Table

A table which contains alternative text (#Table.Variables) is considered to be a custom variable table. Its rows are repeated for each custom variable present in the run. If there are no variables, the table is not shown.

Within the table, special placeholders can be used:

 

(#Name)
When used inside a custom variable table, it represents the name of a custom variable.
 

(#Note)
When used inside a custom variable table, it represents the displayed name of a custom variable.
 

(#Description)
When used inside a custom variable table, it represents the description of a custom variable.
 

(#Value)
When used inside a custom variable table, it represent the value of a custom variable in a human-readable format.

 

Using Image Placeholders

PackBench scans the content of the template and looks for the presence of images which have one of the following alternative texts:

 

(#Icon)

(#ProgressChart)

(#Timeline)

 

They all have a special meaning. Instead of printing the image as it is, the image is replaced with an actual content.

 

The following alternative texts can be used to indicate that the picture has to be changed dynamically:

 

(#Icon)
Represents the icon associated with the workflow used to create the run.
 

(#ProgressChart)
Represents a horizontal progress bar representing the current run progress.
 

(#Timeline)
Represents a chart showing the progress over time.

 

Using String Placeholders

Every standard and custom property can be inserted to any place in a report, by accessing it using the following syntax:

 

(#VariableName)

 

For example, in order to insert the name of the package, write the following text in a .docx template:

 

(#PkgName)

 

finger1

Be aware:

Due to technical reasons. use "#" (hash) as a prefix inside the project template variables. This is different from how they would be used when working with tools, which use "$" (dollar sign) as a prefix character instead.

 

The following variables are available. For more information, refer to the chapter PackBench variables. Some values listed below are only allowed when used within a report template:

 

(#Note)
Represents the description of the run package.
 

(#Status)
Represents a human-readable status of the run package.
 

(#AppName)
Represents the application name of the run package.
 

(#FileName)
Represents the full path to the entry file name of the run package.
 

(#PkgLanguage)
Represents the language of the run package.
 

(#PkgDir)
Represents the full path to the package directory.
 

(#PkgName)
Represents the name of the run package.
 

(#RayFlowGuid)
Represents the identifier of a RayFlow task assigned to the run..
 

(#PkgVendor)
Represents the name of the vendor of the package run.
 

(#PkgVersion)
Represents the version of the package run.
 

(#PkgCreated)
Represents the date of creation of the run.
 

(#Progress)
Represents an integer value in range from 0 to 100, informing about the current progress.
 

(#RunId)
Represents the numeric identifier of the run.
 

(#RunStatus)
Represents a human-readable status of the run.
 

(#Help)
Inserts an integer value in range from 0 to 100, informing about the current progress.
 

(#PkgBitness)
Represents the human-readable platform of the run package.
 

(#Variables)
Represents a list of custom variables (each variable in new line). It is not recommended to use this variable, a much more flexible and better looking option is to use the custom variables table.
 

(#Name)
Represents the name of the workflow used to create the run package.
 

(#WorkflowVersion)
Represents a full version of the workflow used to created the run.