Report Generator

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

processing_settings_reportgenerator1

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.

Info

For network paths specify the full UNC path starting with \\. Mapped drives are not allowed because Scanshare is running inside services and Mapped Drives are not existing in services context.

Info

For the network authentication and allowing authentication on virtual UNC shares you would use \# before your UNC path. e.g.: \#YOUR_UNC_PATH.

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.

Info

The extension will be automatically computed based on the selected report type.

Info

The filename field here allows the use of the UNIQUECOUNTER variable in case an existing file with the same filename is found. Please refer to the Variables appendix for further information on the variable use.

Permissions

processing_settings_reportgeneratorw

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.

Warning

Authentication is not required on local folders (e.g. starting with a local drive letter). If you specify credentials in such case an error will be generated during storing because Scanshare will attempt to obtain the UNC root authentication point.

Word

processing_settings_reportgenerator3

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.

Info

Browse allows to upload the document to the server, this operation stores the document file in the local Scanshare data folder.

Warning

For security and privacy reasons the filename is always referring to the Scanshare data folder and not to a full absolute path. Do not insert absolute paths which will generate instead an error.

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.

Info

Browse allows to upload the document to the server, this operation stores the document file in the local Scanshare data folder.

Warning

For security and privacy reasons the filename is always referring to the Scanshare data folder and not to a full absolute path. Do not insert absolute paths which will generate instead an error.

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.

processing_settings_reportgenerator6

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.

processing_settings_reportgenerator4

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.

Warning

Only 64bits system DSN are listed under the Get DSN function. Make sure to configure the DSN as a system DSN (not user) and under the 64bits ODBC Data Source Windows panel.

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.

TypeColumn valueStyle
Bar ChartInstructions how to generate a bar chart in this format:

COLOR:0xff007dc5;MIN:0;MAX:100;WIDTH:xxx;HEIGHT:yyy;TITLE,VALUE;TITLE,VALUE
ImageFull 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 ParagraphText inserted as new paragraph
Page BreakEmpty
ParagraphText inserted as a current paragraph
TextText
WordFull absolute path to a Word file to insert at this specific point
Info

The value retrieved for the Column may contains also Workflow variables which will be expanded after the value is retrieved and before it is inserted in the target tag.

This is an example of a simple table with only two columns how the data mapping may look like:

clip0949

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.

Previous Article

OMR

Next Article

Smart Form (Invoice)