Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
exclude
maxLevel6
minLevel1maxLevel6
include
outlinefalse
indent
exclude
styledefault
typelist
classprintablefalse
class

Principles of Operation

The Excel Channel renders supported nodes from the abstract report by copying cell patterns from the Excel template(s) and “stamping” them on the Excel report:

  • Cell The cell style is taken from the template.

  • Cell context The cell value is taken from data in the report.

  • Unsupported nodes are silently ignored, thus a report intended for Word or online should always (at least partially) be convertible to an Excel document.

...

  • The style of the pattern cells is copied to the next rows (or columns for generic tables) in the Excel report. This includes format, font, row height and column width, alignment, wrapping, colors, conditional formatting, merging, etc.

  • The content value of the pattern cells is evaluated, then copied. All ${...} expressions in the content value will be treated as JavaScript expressions on report specific data. The expression can access the following identifiers:

...

Pattern Name

Description

Optional

Example Data

header

Rows at the top of a worksheet. Content Value data is taken from the node creating the new worksheet and the report:

Code Block
languagetypescript
data: {
  mainTitle?: string;
  subTitle?: string;
  reportName: string;
  params: object // Execution Parameters 
}

✔️

Code Block
languagejson
"data": {
  "mainTitle": "Rückforderbare Quellensteuern",
  "subTitle": "Vom 01.01.2024 bis 31.03.2024",
  "reportName": "Rückforderbare Quellensteuern",
  "params": {
    "portfolioId": "00001",
    "reportingDate": "2024-03-31",
    ...
  }

footer

Rows at the bottom of a worksheet. Content Value data is the same as for header.

✔️

As for header.

issue

Cells stamped when an issue is encountered (e.g. a missing mandatory pattern). Content Value data is the issue:

Code Block
languagetypescript
data: Issue

Code Block
languagejson
"data": {
  "id": "rep-2024-03-31-15-6",
  "description": "Cell pattern 'data' to stamp DataNode 'returns' not found",
  "severity": "error",
  "source": "rendering"
}

...

For all supported nodes, the following parameters are considered:

Parameter

Description

Content Example

style

The style to apply. Used as name prefix when looking for cell patterns, see https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Style-and-Language-Specific-Cell-Patterns.

Code Block
languagejson
"parameters": {
  "style": "ReclWhTax"
}

pageBreakBefore

Whether this node should be rendered at the top of a new worksheet.

Code Block
languagejson
"parameters": {
  "pageBreakBefore": true
}

renderingOptions.excel.worksheetName

The name of the worksheet if this node creates a new worksheet, i.e. it is the first node or has pageBreakBefore: true.

Note that Excel limits the length of worksheet names to 31 characters.

Code Block
languagejson
"parameters": {
  "renderingOptions": {
    "excel": {
      "worksheetName":  {
        "resolved": "Rückforderbare QST"
      }
    }
  }
}

...

Pattern Name

Description

Optional

Content Example Data

columnHeaders

Row(s) to be stamped for the column headers of the table, repeated if renderingOptions.excel.repeatHeaders: true. Content Value data are the header texts by column id:

Code Block
languagetypescript
data: Record<string,string>

Code Block
languagejson
"data": {
  "ValueDate": "Valutadatum",
  "TradeDate": "Ex-Datum",
  "TransactionId": "Trx-Id",
  "Amount": "Betrag"
}

row.<importance>
row.<importance>.<indent>

Row(s) to be stamped for each data row in the table. A different cell pattern must be specified for each row importance (row.1, row.2 etc.). If a row specifies an indent, there must be a cell pattern for the importance and indent (row.1.1, row.1.2 etc.).

Content Value data are the table facts by column id:

Code Block
languagetypescript
data: Record<string,number | string | boolean | Date | null>

data.rowName contains the row name, if set.

Code Block
languagejson
"data": {
  "ValueDate": "2024-02-14T00:00:00Z", // as Date instance
  "TradeDate": "2024-02-12T00:00:00Z", // as Date instance
  "TransactionId": "41567",
  "Amount": 11424.3
}

rowGroup.<importance>

Row(s) to be stamped for each row group carrying a name. Content Value data is the group name:

Code Block
languagetypescript
data: { groupName: string }

Code Block
languagejson
"data": {
  "groupName": "Current Account EUR"
}

tableHeader

Rows to be stamped before the column headers, repeated if renderingOptions.excel.repeatHeaders: true. Content Value data is the same as for header.

✔️

See header.

tableFooter

Row to be stamped after the last table row. Content Value data is the same as for header.

✔️

See header.

...

If there is no columnHeaders pattern, a VerticalTableNode is rendered in a generic way. This mode of rendering is similar to the Word Channel: each column is rendered individually, depending on its value type. Typical value types are text, amount, count, date. The basic idea is that the style of a column (particularly format and alignment) depends on its value type.

Info

Pattern names containing a value type with a hyphen ('-') need to be written with a underscore ('_') instead (e.g. p-abs is written as p_abs in the template).

Column related pattern names therefore contain the value type:

Pattern Name

Description

Optional

Content Example Data

columnHeader.<valueType>
columnHeader

Row(s) and column(s) to be stamped for the column headers. A different cell pattern must be specified for each value type (columnHeader.text, columnHeader.amount etc.) used.

Repeated if renderingOptions.excel.repeatHeaders: true.

Content Value data is the header text:

Code Block
languagetypescript
data: { header: string }

Code Block
languagejson
"data": {
  "header": "Betrag"
}

fact.<valueType>.importance
fact.<importance>

Row(s) and column(s) to be to be stamped for each fact in the table. A different cell pattern must be specified for each value type (fact.text.1, fact.amount.1 etc.) and for each row importance (fact.text.1, fact.text.2 etc.) used.

Content Value data is the fact value:

Code Block
languagetypescript
data: { value: number | string | boolean | Date | null }

Code Block
languagejson
"data": {
  "value": 11424.3
}

rowName.<importance>

Row(s) and column(s) to be stamped for the row name, if set.

Content Value data is the row name:

Code Block
languagetypescript
data: { rowName: string }

Code Block
languagejson
"data": {
  "rowName": "Gebühren- und Zinsabrechnung"
}

rowGroup.<importance>

Same as https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Templated-Table-Rendering.

See above.

tableHeader

Same as https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Templated-Table-Rendering.

✔️

See header.

tableFooter

Same as https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Templated-Table-Rendering.

✔️

See header.

Note

Generic tables can only be rendered if there is no matching columnHeaders pattern in any of the templates used (main template and configured templates). It is therefore a good idea to always prefix columnHeaders with a style if a template is also used for generic tables.

...

Pattern Name

Description

Optional

Example Data

section

Rows to be stamped for a section. Content Value data is taken from the node:

Code Block
languagetypescript
data: {
  mainTitle?: string;
  subTitle?: string;
}

Code Block
languagejson
"data": {
  "mainTitle": "Renditeattribution",
  "subTitle": "Vom 01.01.2024 bis 31.03.2024, nach Anlagekategorie"
}

...

Pattern Name

Description

Optional

Example Data

paragraph

Rows to be stamped for a paragraph. Content Value data is taken from the node:

Code Block
languagetypescript
data: {
  mainTitle?: string;
  subTitle?: string;
  content?: string;
}

Code Block
languagejson
"data": {
  "content": "Disclaimer: the information in this document is..."
}

...

A DataNode renders the contents of its data object. It can be used to render arbitrary content data to the Excel document, as the type of the data object itself is user defined. This allows to render relatively complex objects into a large cell pattern.

Pattern Name

Description

Optional

Example Data

data

Rows to be stamped for the data object. Content Value data is taken from the node:

Code Block
languagetypescript
data: object | object[]

If the data is an array, the pattern is stamped for each array element.

Code Block
languagejson
"data": [
  { "id": "A", "name": "Letter A", "order": 1 },
  { "id": "B", "name": "Letter B", "order": 2 }
]

...

Pattern Name

Description

Optional

Example Data

error

Rows to be stamped for an error. Content Value data is taken from the node:

Code Block
languagetypescript
data: {
  error: string;
  message?: string;
  code?: string;
}

Code Block
languagejson
"data": {
  "error": "Error: No building block with name 'BalanceBB' registered.",
  "code": "production-rep-20231213-170410-1",
  "message": "Fehler bei der Reportproduktion"
}

...

If the report parameter addExcelTrace to is true, the rendering process is traced for each pattern, and the trace appended to the Excel document as worksheet "Pattern Usage Trace".

...