The Report Generator module allows to create dynamic, rich and formatted data report out of the workflow processed data.
The reports are generated starting from a pre-configured template which will be filled automatically with dynamic processing data based on the data source mapping configured in the module.
Dynamic date is replaced according to placeholders which are required to be inserted in the document source / template and which will be used by their respective mapping below.
A placeholder is a text in the format of:
{[NAME]}
Where NAME is the name of the variable used in the Mapping table. The complete placeholder will be replaced with the data, according the specified type, in the rule mapping for this name.
The left hand side menu shows the available settings section. Settings are displayed according the selected section, based on the selected report format a specific setting section will be displayed with specific format settings.
General
Format
Select the format of the output report, available formats are:
- Word
Path(s)
Enter an output path manually, or select Browse to browse to the right folder. You may also insert variables by selecting the Variable button on the right, so you would use e.g.
C:\Output\%REPORT_TYPE%\
to store a report to a subfolder based on its report type. Of course in order to do so, you must first set up a question which lets the user choose the root folder.
Multiple paths are possible as well by separating them with (;) semicolon, in this case the report will be created in every path.
Filename
Enter the filename for the report to create, or click on the Variables button on the right, to select a variable which will contain the filename.
Permissions
Username and Password
Enter a username and password (if needed) or select a variable which will contain the username / password, to access the restricted network output folder.
Word
Source document
Browse to or enter the report source document, or click on the Variables button on the right, to select a variable which will contain the document.
The source document represents the template of the report (.docx) in which the Report Generator module will attempt to replace the dynamic values configured in the Mapping section.
This document is used in combination of the template, if specified. Eventually it might be also an empty Word document if the configuration is done in the template file directly.
Document template
Browse to or enter the report template document, or click on the Variables button on the right, to select a variable which will contain the document.
The document template represents the stylesheet Word template (.dotx) which will be merged with the previous Source document in order to create the source document where to replace dynamic data.
If a template document is used to customize styles the same template document can be used also as source document by inserting an empty Word document in the source document above.
A sample document / template is what shown below where we expect a Company and an Author to be inserted.
Mapping
This section is the core section of the Report Generator module, it contains a connection to an external data source, via ODBC drivers, which is used to fetch the dynamic data to use in the report.
For every data a new rule is created which is mapping the source document / template placeholder to a piece of information, of a certain type, with certain properties, which can be retrieved from the target data source.
Connection string
Enter a connection string for the target database, or click on the Variables button on the right, to select a variable which will contain the connection string.
You can either use the Get DSN button to list available system configured DSN or use the Wizard button to generate a new connection string.
The table shows a list of all configured mapped Rules.
The view of the table is very easy and intuitive:
• Tag
The tag in the source document / template.
• Search column
The column to look for the tag in the target data source.
• Column
The column to query in the target data source for the expected value to use for this tag.
• Table
The table to use in the query in the target data source, for this rule.
• Type
The type of rule corresponding to the type of data which is expected to be retrieved and inserted in the source / template document.
• Id
The id associated with your rule. It is unique and it is the id of your rule inside the DB.
By pressing the New button a new Rule can be created. The same dialog is displayed when editing existing Rules from the list.
Map
Tag
Select an available tag from the list to configure for this map rule.
The tags are automatically read from the source / template documents. If no list is displayed you either missed the source / template document or either something in wrong in them or with the syntax of the tags.
Search column
Enter the search column to look for the tag in the target data source, or click on the Variables button on the right to select a variable which will contain the column or use variables dynamically inside the query.
The search column represents the column where the current Tag selected above will be found in the target data source. The column could be also a sub query and it will be used in a query style like:
SELECT x
FROM t WHERE SEARCHCOLUMN
= ‘TAG’
Column
Enter the column to look for the value to retrieve in the target data source, or click on the Variables button on the right to select a variable which will contain the column.
The column represents the column where the value for the found Tag above can be retrieved, in correspondence of the previous Search Column.
Table
Enter the table where the Search Column and the Column will be looked for in the target data source, or click on the Variables button on the right to select a variable which will contain the table.
Type
Select the type of data which is expected to be used for the current rule / Tag. Available types are:
- Bar Chart
- Image
- New Paragraph
- Page Break
- Paragraph
- Text
- Word
Based on the selection the expected value in the Column field needs to respect a specific format and the following Style field will have different meaning according the table below.
Type | Column value | Style |
---|---|---|
Bar Chart | Instructions how to generate a bar chart in this format: COLOR:0xff007dc5;MIN:0;MAX:100;WIDTH:xxx;HEIGHT:yyy;TITLE,VALUE;TITLE,VALUE | |
Image | Full absolute path to an image to insert as Bar Chart in the source / template document. | May contain the dimensions expressed as: WIDTH: xxx; HEIGHT: yyy |
New Paragraph | Text inserted as new paragraph | |
Page Break | Empty | |
Paragraph | Text inserted as a current paragraph | |
Text | Text | |
Word | Full absolute path to a Word file to insert at this specific point |
This is an example of a simple table with only two columns how the data mapping may look like:
Style
Enter the style to apply for the current map rule, or click on the Variables button on the right to select a variable which will contain the style.
This field has meaning according the type of rule as specified in the previous mapping types table.