Organizing report definitions¶
All report definitions are stored in the database and are accessible through the Report explorer. For convenience report definitions are organized in groups.
Create a new group¶
Description | Illustration |
---|---|
Create a new group by right clicking on the root node or an existing group, and select Add new group from the context menu. The new group is created as a subgroup under the root (database) node or the group that was selected. |
|
Once the new group has been added it can be renamed by right clicking on the group. Additional functionality for copy, cut, delete and paste groups are also available. Shortcuts for each of these action are also available (see context menu) Once a group have been created a report definition can be added to it by clicking “Add new report definition…”. |
Defining reports¶
This section describes the process of creating and modifying report definitions.
Add report definition¶
Description | Illustration |
---|---|
Report definition can be created in the Report explorer by right-clicking either on a Database node or a group node and clicking “Add new report definition…”. | |
The system will display a dialog where the report type should be selected (currently MIKE OPERATIONS only supports Microsoft Word). The report definition name will be use in the tree view. The report template file is the MS Word document holding the content controls (the template should already be created on disk, for more information see Creating report templates). Clicking “remove file from disk” will delete this file after import. Report definition template allows the user to reuse an existing report definition to save on time configuration. Each content control will be configure in the same way as the control control having the same tag in the report definition template. |
|
After clicking the Add report definition button system will create the report definition and open a data view with report content configuration |
Define report content¶
Description | Illustration |
---|---|
Report content can be edited at any time. The data view with content configuration is shown when the report definition is created but can also be invoked by right clicking on report and selecting “Edit content…” or simply by double-clicking on a report definition in the report explorer. |
|
Content configuration dialog contains of a list of content items identified in the report template and their configuration. For each content item a Content Type (Text, Image, Table or Report) and Content Source (e.g. Favorite image, Indicator value, Timeseries table) is selected. |
|
After selecting the content item in the list its detailed configuration is displayed. Here the user can: |
|
When the content item is configured it is very useful to preview the content by clicking “Preview” buton (doesn’t work for Report content type) to be sure that the content is exactly what is expected. System will display a dialog with the generated content. |
|
After configuring all content items (the ones that were modified are bold) “Save” button needs to be clicked to persist the changes and have them used during report generation. |
Set report properties¶
Description | Illustration |
---|---|
The report properties are specific for a given report type and allow user to set some properties of the output report (e.g. a title or author of a generated MS Word document). In order to set report properties select report definition in the report explorer. |
|
Report properties will be displayed in the report definition properties dialog under the Report Properties->Document node . For the MS Word based report following document properties can be set: Author, Category, Comments, Status, Subject, Tags, Title. Property changes are autosaved after each change. |
|
The properties are set on the generated report (e.g. Word document) |
View report template¶
Description | Illustration |
---|---|
User can always save to disk and view the report template that is used to generate a given report by selecting the report definition in explorer, right-clicking and selecting “Save template as…” | |
A dialog will be shown where the user can select where the template should be saved and whether to open the template after it’s saved. When “Open template after save” option is checked the default editor for the report type will be opened, e.g. MS Word. |
Update report template¶
Description | Illustration |
---|---|
The template that is used to generate the report can be changed at any moment. User can either modify the template that is stored with the report definition or can upload a completely new file from disk. In the case of the first option user should select the report definition in the explorer, right-click and select “Save template as…” |
|
A dialog will be shown where the user can select where the template should be saved and whether to open the template for edit. When “Open template after save” option is checked the default editor for the report type will be opened, e.g. MS Word. |
|
After the user has made all changes in the template he can upload it by right-clicking on the report definition in the explorer and selecting “Update template…” | |
In the Update template dialog user can select the template file that should be uploaded and optionally select the file to be removed from disk. After pressing the “Update” button the new template will be saved in the report definition and report content items adjusted (either added or removed) to meet the new template content. |
Defining derived reports¶
A derived report definition is a report definition that shares the report template and/or content configuration with another report.
In the example there’s a base Report A which uses DocA.docx template and has two content items defined: Content item1 and Content item 2.
If a user wants to have a report which has the same content configuration as the report A (in this case TS Plot (T1, T2) and Spreadsheet table (S1)) but use a different layout or style in the output report than Report A he can derive a Report B from the Report A and set the new report template in the Report B. This way Report B will always use the DocB.docx as the template but will have the content generated according to the configuration of ReportA.
If a user wants to keep the report template and configuration of some of content items from one report definition but change the configuration of other content items (in the example the TS Plot for Content item 1 should be based on time series T4 and T5 instead of T1 and T2), he can derive a Report C from Report A and change the configuration of content items in Report C.
Add derived report definition¶
Description | Illustration |
---|---|
In order to create a derived report definition user should right-click in the explorer on the report definition he wants to derive a new report definition from and click “Create derived report definition…” | |
System will display a dialog where user should enter the name of the newly created derived report and click “Create”. | |
After creting the derived report definition system will display it in the report explorer with a special icon indicating that the report definition is derived from another one. The report definition from which another report definition is derived can be found in property dialog under Base report definition. |
|
Override derived report template¶
Description | Illustration |
---|---|
In order to override the template in the derived report definition select the derived report definition in the explorer, right-click and select “Update template…” | |
In the Update template dialog user should select the template file that should be uploaded and optionally select the file to be removed from disk. After pressing the “Update” button the new template will be saved in the report definition and override the template from the base report definition. Report content items for the derived report will be adjusted (either added or removed) to meet the new template content. |
|
The new report template will be shown in report definition properties window. |
Override derived report content¶
Description | Illustration |
---|---|
In order to override the report content in the derived report definition select the derived report definition in the explorer, right-click and select “Edit content…” | |
The content configuration dialog will be shown with a new column (Inherited) which indicates whether the content configuration for a given content item is inherited from the base report definition or defined in the derived report definition. | |
In order to override the content item definition Inherited checkbox has to be unchecked. This will make the content item configuration editable. User can then set the content according to his needs. |
|
After making all changes the report definition should be saved by clicking on the Save button. |
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.
Description | Illustration |
---|---|
Go to File -> Options | |
Select Customize Ribbon and check Developer tab. | |
Developer tab will appear in MS Word ribbon |
Text content¶
Description | Illustration |
---|---|
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¶
Description | Illustration |
---|---|
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¶
Description | Illustration |
---|---|
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¶
Description | Illustration |
---|---|
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. |
Configuring report content¶
MIKE Workbench can produce Text, Table, Image and Report contents from many different sources. This section will describe configuration and formatting of each built-in content source.
Text¶
Description | Illustration |
---|---|
This is the simplest content source. It simply produces the text that the user specifies. Configuration |
|
Example output of text content source. |
Indicator value¶
Description | Illustration |
---|---|
This content source returns a value that is represented by an indicator. Configuration |
|
Example output of indicator content source. |
Script text output¶
Description | Illustration |
---|---|
This content source returns text that is produced by a script. Configuration |
|
Example script. Input parameters are optional but the return value has to be of type string. |
|
Example output of script text output content source. |
Feature class attributes table¶
Description | Illustration |
---|---|
This content source returns a table of all feature attributes in a given feature class. Configuration |
|
Example output of indicator content source. |
Script table output¶
Description | Illustration |
---|---|
This content source returns a table that is produced by a script. Configuration |
|
Example script. Input parameters are optional but the return value has to be of type string[,]. | |
Example output of script table output content source. |
Spreadsheet table¶
Description | Illustration |
---|---|
This content source returns a table based on a cell range in a spreadsheet. Configuration If left empty tabular data from first sheet will be taken. If left empty the whole used range within the selected sheet will be taken. Formatting Otherwise data will be formatted according to Number format, Bollean text and Date format options. |
|
Example output of spreadsheet table content source. |
Time series table¶
Description | Illustration |
---|---|
This content source returns a table of time series values. Configuration Formatting |
|
Example output of time series table content source. |
Favorite image¶
Description | Illustration |
---|---|
This content source returns an image based on a saved favorite (gis map or time series plot). Configuration Formatting |
|
Example output of favorites image content source. |
Script image output¶
Description | Illustration |
---|---|
This content source returns an image that is produced by a script. Configuration Formatting |
|
Example script. Input parameters are optional but the return value has to be of type byte[]. |
|
Example output of script image output content source. |
Spreadsheet image¶
Description | Illustration |
---|---|
This content source returns an image based on a spreadsheet cell range. Configuration Formatting |
|
Example output of favorites image content source. |
Time series plot¶
Description | Illustration |
---|---|
This content source returns a time series plot image. Configuration Formatting |
|
Example output of time series plot content source. |
Report¶
Description | Illustration |
---|---|
This content source returns a report that will be used as a sub-report. Configuration Formatting |
Report script output¶
Description | Illustration |
---|---|
This content source returns a report that is produced by a script. Configuration Formatting |
|
Example script. Input parameters are optional but the return value has to be of type DHI.Solutions.ReportManager.Interfaces.IreportHandle |
Generating reports¶
Generate report¶
Description | Illustration |
---|---|
After a report definition is created in the system, a report can be generated. A report can be generated in 4 ways: This tool can also be used in a script or in a sequence. |
|
The system will display a dialog where a user can provide various report generation settings. Settings are divided into two sections: MS Word settings (these are report type specific settings, which can be different for different report types General settings (settings which are independent of the report type). For MS Word, the following can be configured: General settings: A path can either be a folder, e.g. /reports/, or a document name, e.g. /reports/myreport.docx. Folder paths should end with ‘/’) |
|
After pressing the “Generate” button the system will generate the report and show a success notification dialog. If any problems occur the system will display a warning dialog with details about each problem. |
|
Change report generation settings¶
Description | Illustration |
---|---|
Each time a report is generated settings need to be provided. In order to save time, settings can be defined once, saved and then reused each time a report is generated. Settings can be saved either for current user or for every user in the workspace. In order to change settings for a given report definition select the report definition in report explorer, right-click on it and click “Change settings…” |
|
System will display a dialog where a user can provide various report generation settings. For description of each settings please refer to Generate report. After the settings have been set the user should select whether they should be saved only for him or for evey user in the workspace “Change settings for the workspace” and click save. The next time he or anyone (in case the settings have been saved for the workspace) generates the report the saved settings will be automatically loaded into report generation settings dialog. |