Creating report templates¶
This section describes creation of report templates for supported report types.
Currently supported report types are:
- MS Word
A report template is a file containing both static content (will not change during report generation) and dynamic content (will be substituted with MIKE Workbench data during report generation). This section will focus on definition of dynamic content in report temlpates. For information on how to define static content for each report type please refer to user manual of corresponding reporting tool (e.g. MS Word).
MIKE Workbench can produce following types of content:
- Text
- Table
- Image
- Report
Placeholders for each of these types may be differently configured in a reporting tool.
MS Word¶
MS Word report templates rely on XML based Word documents and content controls. These are available since MS Office 2007.
For the Word document to be usable as a report template it needs to be saved as a .docx file.
To insert content control that will be replaced with MIKE Workbench data, one needs to enable Developer tab in MS Word.
Go to File->Options.
Select Customise Ribbon and check Developer tab.
The Developer tab will appear in MS Word ribbon.
Text content¶
Text content can be defined at many levels, e.g. inline, as a standalone paragraph, inside a table cell.
In order to add a placeholder for text content, put a cursor at the desired place in Word document and click on Plain Text Content Control
Plain Text Content Control will appear in the Word document.
Now a tag needs to be assigned to the content control, so that MIKE Workbench can refer to it.
Select content control by clicking on it and then click Properties.
In properties dialog tag property needs to be filled. Entered value will be later user to identify this content item when configuring content for report in MIKE Workbench.
Tag values of content controls can be easily viewed by switching to Design mode.
After the text control is added it can be formatted like a standard text in the document.
Select content control and apply desired formatting.
Table content¶
Table content placeholder can be defined in several ways: as a new table, an existing table, a row in existing table.
To define a placeholder for a new table content, put a cursor at the desired place in Word document and click on Rich Text Content Control
Rich Text Content Control will appear in the Word document. Assign a tag to the content control according to the steps described in Text content
Now when a table will be generated in MIKE Workbench it will be inserted in the place of added content control. The drawback of this method is that style of the table can’t be set before data is inserted in the document.
Second option to define a placeholder for MIKE Workbench table data is to use an existing table from the document.
To achieve this, create a table the standard way in Word document (it is advised that the number of columns of the table in document and number of generated columns match), format it as desired, select it and click on Rich Text Content Control.
Content control will be created around the table. Assign a tag to the content control according to the steps described in Text content.
When MIKE Workbench generates the data it will be placed in the table. Row and column numbers in the table will be adjusted to match the number of columns and rows in generated data.
For situations when table data from MIKE Workbench should be merged into an existing table a third way of defining table placeholder was envisioned.
Create or select an existing table in the document, select a single row in the table and click on Rich Text Content Control.
Content control will be created around the selected row. Assign a tag to the content control according to the steps described in Text content.
When MIKE Workbench generates tabular data the row will be filled with it. If there are more than one row in the generated data corresponding number of rows will be inserted.
Image content¶
To define a placeholder for an image, put a cursor at the desired place in Word document and click on Picture Content Control.
Picture Text Content Control will appear in the Word document. Assign a tag to the content control according to the steps described in Text content
Set the image properties (size, position, etc.) according to your needs.
Now when an image will be generated in MIKE Workbench it will be inserted in the place of added content control.
Report content¶
To define a placeholder for a sub-report, put a cursor at the desired place in Word document and click on Rich Text Content Control
Rich Text Content Control will appear in the Word document. Assign a tag to the content control according to the steps described in Text content
Now when a sub-report will be generated in MIKE Workbench it will be inserted in the place of added content control.