Reporting

With the help of reports, information about map objects can be summarized and prepared in a PDF file. These objects are selected either in advance by the user in the Result Center or by a fixed query.

reporting

Manage report templates

Report templates can be added or removed using map.apps Manager. These centrally managed templates can be used in any number of apps. Details are described on page Managing Report Templates.

Create reports for entries in result center

Required bundles: reporttool, result-ui

General settings

To provide the user with the possibility to create reports from the Result Center (for example after a spatial selection), the reporttool bundle must be added to the app. Without further configuration, the default template stored in map.apps Manager is used. The following parameters can be used to change this default template and other options:

Name Description

defaultReportId

ID of the default report.

This report is used if no mapping is found for a certain data source.

Default value: s_default

defaultFileName

Default filename for the generated report.

Their filename is used if no mapping is found for a certain data source.

Default value: Report.pdf

directDownload

Defines whether to download a report directly instead of showing it in a window.

Default value: false

mappings

Mappings to combine certain data sources with certain reports.

For details, see following section.

windowProperties

Properties for the window that shows the report (only used if property directDownload is set to false).

Sample configuration
{
    "reporttool": {
        "ReportTask": {
            "defaultReportId": "s_default",
            "defaultFileName": "Report.pdf",
            "directDownload": false,
            "mappings": [],
            "windowProperties": {
                "maximizable": true,
                "closable": true,
                "marginBox": {
                    "w": 400,
                    "h": 570
                }
            }
        }
    }
}

Assignment of report templates to data sources

Use the following configuration to assign specific report templates to individual data sources.

{
    "reporttool": {
        "ReportTask": {
            "mappings": [
                {
                    "storeId": "country_store",
                    "reportId": "country_report",
                    "fileName": "Country_Report.pdf",
                    "directDownload": true
                }
            ]
        }
    }
}
Further information about configuration can be found in the bundle documentation .

Configure Static Reports

Required bundles: reporttool, toolset

With the help of static reports, preconfigured report requests can be linked to a tool. This tool can be placed in any tool set. Using the query parameter, the selection of the data contained in the report can be dynamically linked to any query (example: create a report on all construction sites with the status in progress).

The following code sample shows the configuration of a static report tool:

{
    "reporttool": {
        "StaticReportTool": [
            {
                "id": "statesReport",
                "title": "Static Report for Median Ages",
                "storeId": "medianAgeStore",
                "query": {
                    "$or": [
                        {
                            "name": "Arizona"
                        },
                        {
                            "name": "California"
                        },
                        {
                            "name": "Nevada"
                        }
                    ]
                },
                "iconClass": "icon-globe"
            }
        ]
    },
    "toolset": {
        "ToolsetManager": {
            "toolsets": [
                {
                    "id": "tools",
                    "tools": [
                        "statesReport"
                    ]
                }
            ]
        }
    }
}
Further information about configuration can be found in the bundle documentation .