Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A cell pattern is a single, rectangular range of cells in a template with a name assigned to it. Names are assigned in Excel either by selecting a cell or cell range, then defining a name for it, or in the Name Manager.

...

See [Supported Node Types] https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Supported-Node-Types for the names to be assigned.

  • The style of the cells is copied to the stamped cells in the Excel report. This includes format, font, row height and column width, wrapping, colors, conditional formatting, merging, etc.

  • Some patterns are optional. These are only rendered if defined in the template.

  • The content of the cells is evaluated, then copied. All ${...} expressions in the content will be treated as JavaScript expressions on report specific data.

Identifier

Description

Example

data

The data to be rendered. This is e.g. a node, a row header, a table fact or a report specific data object. See [Supported Node Types] https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Supported-Node-Types for details.

${data.mainTitle}

translate

Render inline language dependent content. Takes an ITranslations dictionary object mapping languages to translations.

${translate({ de: "Konto", en: "Account", fr: "Compte" })}

format

Formatter for dates and date periods, where the Excel formats cannot be used.

${translate({ de: "Seit", en: "Since" })} ${format(data.startDate)}

...

Page headers and footers set in the first worksheet of the main template are copied to all worksheets produced. They may contain ${...} expressions, like cell patterns. The data attributes supported are the same as for header and footer in [common cell patterns] https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Common-Cell-Patterns.

Supported Node Types

The Excel Channel supports a limited set of report nodes. All The other node types in an abstract report are ignored, but not their childrendo not produce output in the Excel document.

Common Cell Patterns

For all supported nodes, the following cell patterns are rendered:

Pattern Name

Description

Optional

Content Data

header

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

✔️

Code Block
languagejson
"data": {
  "mainTitle": <node mainTitle>,
  "subTitle": <node subTitle>,
  "reportName": <report name>,
  "params": <report execution parameters>
}

footer

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

✔️

As for header.

issue

Cell created when an issue is encountered (e.g. a missing mandatory pattern). Content data is the issue.

Code Block
languagejson
"data": {
  "id": <issue id>,
  "description": <issue description>,
  "severity": "error",
  "source": "rendering"
}

...

Parameter

Description

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",
  ...
}

renderingOptions.excel

The Excel Channel rendering options. The supported options are:

  • worksheetName: Name of the worksheet if this node creates a new worksheet. Note that Excel limits the length of worksheet names to 31 characters.

  • repeatHeaders: Mark tableHeader and columnHeaders to be repeated on each page (VerticalTableNode only). If there are multiple VerticalTableNodes rendered into a single worksheet, only the headers of the last one with this option will be repeated.

  • tableWidth: The total width of all columns of a generically rendered table, see [Generic Table Rendering] https://bmpi.atlassian.net/wiki/spaces/CRDOC/pages/3252125697/Working+with+Excel+Templates#Generic-Table-Rendering.

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

...

Worksheets: SectionNode

A SectionNode is rendered with renders its titles, and may start a new worksheet.

Simple Text: ParagraphNode

A ParagraphNode is rendered as single line of text.

DataNode

...

renders its content.

Arbitrary Data: DataNode

A DataNode renders the contents of its data object. It can be used to render arbitrary content to the Excel document, as the type of the data object itself is user defined.

Since the cell patterns depend on the type of data in the object, a DataNode must have a style.

Production Errors: ErrorNode

An ErrorNode (typically the result of an error during report production) renders the error details.

Debugging Excel Rendering

...