Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Apart from Building Blocks parameters are rendering options which are context insenstivie, meaning they can be set on every Building Block. It depends however on the wordchannel implementation whether these rendering options get interpreted or not. Rendering options are set on the node itself in the abstract report.

Add a rendering option

Rendering options can only be added via the code view of a building block and must be of the following json schema

{
  "renderingOptions": {
    "wordchannel": {
      "<Key>": <Value>,
      ...
      }
    }
}

Note: Machinata uses its own rendering options under the "machinata" object

Existent rendering options

Name

Description

Application

repeatRowGroupHeaders: boolean

Repeat the row group header if rows of its group span across multiple pages.

VerticalTableNodes

repeatRowHeadersUntilLevel: number

Repeat row headers up until (and including) the specified level of the tree.

?

barchartMinScaleValue: number

Defines the minimum scale value for the bar chart

VerticalTableNodes

maxTableRowsOnPage: number

Defines the maximum rows for a table before inserting a pagebreak (VerticalTable)

?

minTableRowsOnPage: number

Defines the minimum rows after the last pagebreak (VerticalTable)

?

tableChartLevelColorShades: string[]

Defines the color shades which are used to overwritting the table charts. The i-th color is used for the i-th level (hierarchical)

VerticalTableNodes

Implementation Checklist

Reporting Solution:

  • The building block has to set the renderingOptions field of its returned ReportNode (e.g., VerticalTableNode)

Core Implementation: In https://bitbucket.org/bmpi/ngr/src/24111d24dfdc74666350e62787ccec99768a2357/ngr-core/src/Rendering/RenderingOptions.ts#RenderingOptions.ts-49 in the WordchannelOptions class:

  • Add a new optional field with the rendering option name and type

  • Extend the fromJson method to support the rendering option field from the abstract report

Wordchannel: In the https://bitbucket.org/bmpi/ngr-word/src/d4c1b9baf7bceda820711b54ac1354aef57e42ea/ngr-wordchannel/src/main/java/ch/bmpi/ngr/wordchannel/rendering/ChannelOptions.java#ChannelOptions.java-3:3 class:

  • Add a new field (optionally with an default value)

  • Write a get- and set-method for the rendering option

The get- and set-method names need to be exact, as they are used for matching when transferring from abstract report to wordchannel!

  • Call the get-method on a reporting node anywhere in the wordchannel with node.getChannelOptions().<getMethodName>()

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.