Skip to content

Report variables

Prerequisites


Report variables for Grafana dashboards

The following variables, which are relevant for report creation, can be defined when editing a report. In addition, all variables of any type defined in Grafana can be overwritten.

  • Use report variables


    Use report variables to dynamically customize your reports.

    show instructions


Layout variables

Layout variables have the type "Layout" in the m2v app and specify, for example, the layout of the header of a report. These variables cannot be defined in Grafana, but only in the m2v app.

Variable Description Default value
logo URL for logo in header and title page Cloud logo
language Language of associated reports (en or de) en
title Title in header Dashboard title
subtitle subtitle in header dashboard subtitle
companyInfo Company address Info about the selected company
coverTitle title on title page dashboard title
coverShowCompany Company address on title page false
coverSubtitle subtitle on title page dashboard description
coverPreparedBy Author Information blank
coverOrientation cover orientation portrait/landscape portrait
footerInfo free text in the footer empty
tableLimit Maximum data records for tables 50
csvDelimiter CSV file delimiter ,
csvDateformat Date format for CSV files Language-dependent (see here)
showTimezone Show time zone in report
Variable Description Valid values Default value
printDate print date in header true, false true
headerCompanyInfoPlacement company address placement left, middle, right left
headerTitlePlacement title placement left, middle, right middle
headerDatePlacement date placement left, middle, right right
footerPageCountPlacement page count placement left, middle, right right
footerInfoPlacement free text footer placement left, middle, right left

Panel-specific variables

Panel-specific variables have the type "Parameters" in the m2v app and refer to the display of the dashboard within the report. If these variables are specified in the m2v app, they automatically overwrite values with the same name that were potentially previously defined in Grafana as a data source.

Each panel can also be output as a single image or as a table by using certain variables. The following variables are available:

Variable Effect
single The panel is also printed in large format on a separate page
newPage A page break is generated after this panel
portrait Changes the orientation of the single page to portrait format, landscape format by default
csv A CSV file is created for this panel
hidden The panel is not displayed in the report
tablePrint A table is created for this panel and attached to the report
tableLimit Determines the number of data records that are output in the table in the report
csvLimit Determines the number of data records that are output in the generated CSV file

User-defined variables

Note

For technical reasons, a new temporary dashboard must be created for an overwritten variable. This dashboard is deleted again after successful report generation.

In the Report details, it is generally possible to overwrite all variables defined in Grafana regardless of their type. This makes it possible, for example, to adjust the aggregation period of the values, the aggregation function or other variables used for different purposes without having to create a new dashboard.

Placeholders for metadata

If the report is linked to a machine, the metadata of the machine can be used in the report variables. To do this, you must insert the English key of the meta data definition in the following schema in a variable: ${MetaData_KEY}. For example, if the English key is Location, the corresponding entry is called ${MetaData_Location} (spaces in the key must be replaced with _).