Excel report templates

The default location for templates is C:\ProgramData\Cadmatic\Draw [version number]\Electrical\DB\ReportFiles.

Database references in report template

A data field name enclosed with $ characters refers to the database field, e.g. label $ID$ refers to the ID field.

You can copy the reference from the report tool to an Excel template via the clipboard by right-clicking the column heading and selecting Copy to clipboard > $ID$.

You can attach several fields to the reference, e.g. the "ID is $Position$-$ID$" could produce the value ID is MCC1-K1 in the report.

The reference can be used in a formula of the report template, for example, =MID("$ID$";SEARCH("=";"$ID$")+1;10).

Multiple alternative fields can be added to single cell by separating tags with vertical bar i.e. pipeline character, for example "$Object ID|Position$". First value that is not empty will be  used.

For the heading section of the report, values can be retrieved from project settings or from a filtered field:

You can refer to the project settings with the prefix P::

  •  $P:Name$ = Project name

  •  $P:Job number$ = Project work number

  •  $P:Target 1$ = Project target information 1 (project target information 2–6 similarly)

  • $P:District$ = Project district

  • $P:Block$ = Project block

  • $P:Project Description$ = Project description

  • $P:Customer Number$ = Project customer number

  • $P:Site$ = Project site

You can refer to the data row fields with the prefix H:, e.g. $H:Location$.

  • The value is retrieved from the first data row. If different data rows have different values, a void value is taken to the heading table.

  • This is usually a field for grouping or a field used in filtering.

Translations

When translating into another language, the original language (= the design language in the common project settings) can be obtained with marking D:, i.e. $D:Description$.

In addition, as a heading data: $HD:Description$

If the field already has a version in another language, such as product information names and wire colors, these will be used. However, if the user has defined this field as one to be translated separately, the translation is retrieved from the dictionary instead of using the existing field.

Exporting / importing data when using DM

DMOUT_field – The field value is always exported from DM towards the report.

DMIN_field – The field value is always exported from the report towards DM.

DM_field – The field value is exported from the report into DM when creating a new report, but from DM into the report when updating.

For example, DMIN_Name1 is a field name, not a value:

Note: The report template must show sheet tabs. In Excel, the setting is File > Options > Advanced > Display options for this worksheet > Show sheet tabs.

Related Topics