Class

TableComponent

TableComponent

Component which maps a table.

Since:
  • 5.0

Extends

Methods

addRow() → {TableRow}

Adds a new row to the component. If the number of template rows is greater than 1 the created row will represent multiple actual rows internally.

See:

The created row.

TableRow

allowGrowth() → {TableComponent}

Allows table to overflow to another slide. A slide that contains a growing table will be cloned when the table exceeds the maximum specified height. Any overflowing rows will be added to new slide(s). The maximum table height can be controlled by either #withMaximumHeightPerSlide or #withMaximumDataRowsPerSlide. If no specific maximum height is defined, it defaults to the height of the table in the presentation template.

Unlike regular tables, growing tables are also allowed to shrink, i.e. when there is not enough data to fill all template rows the surplus rows are removed.

Available in ppt reporting only! In word reporting tables will always grow.

See:

The component itself.

copy() → {Component}

Create a mutable copy of the component.

This will copy only the component, not the actual shape in the template.

Inherited From:

Mutable copy of the component

Component

hide() → {Component}

Hides the component. Short for #withHidden(true)

Available in ppt and word reporting only!

Inherited From:

The component itself.

Component

moveX(xPosition) → {Component}

Moves the component on the x axis relative to its current position where a positive number will move to the right and a negative to the left.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
xPosition number

The amount to move the component on the x axis. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

moveY(yPosition) → {Component}

Moves the component on the y axis relative to its current position where a positive number will move to the bottom and a negative to the top.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
yPosition number

The amount to move the component on the y axis. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

withBackgroundColor(color) → {Component}

Sets the background color of the component.

Parameters:
Name Type Description
color string

A string that represents a 24-bit opaque color.

Inherited From:

The component itself.

Component

withBorder(thickness, r, g, b) → {Component}

Sets the border of a component.

Parameters:
Name Type Description
thickness number

Thickness of the border in pt

r number

The red value of the border color.

g number

The green value of the border color.

b number

The blue value of the border color.

Inherited From:

The component itself.

Component

withBorder(thickness, color) → {Component}

Sets the border of a component.

Parameters:
Name Type Description
thickness number

Thickness of the border in pt

color string

A string that represents a 24-bit opaque color.

Inherited From:

The component itself.

Component

withHeader() → {TableComponent}

First row will be considered as header of the table. Processing of rows will start at 2nd row.

Available in ppt reporting only! In word reporting the start of the actual table data is determined by the position of the RepeatStart field.

The component itself.

withHeaderRow() → {TableRow}

Add a header row for the component. Processing of rows will start at 2nd row. First row will be considered as header of the table. This method returns a TableRow object to be able to put substitutions for placeholders in header row of table

Available in ppt reporting only! Use regular placeholders for word reporting instead.

A table row to put substitutions for header row placeholders.

TableRow

withHidden(hidden) → {Component}

Set the visibility of the component.

Available in ppt and word reporting only!

Parameters:
Name Type Description
hidden boolean

Whether the component shall be visible or not.

Inherited From:

The component itself.

Component

withMaximumDataRowsPerSlide(rows) → {TableComponent}

Set maximum number of data rows (i.e. rows excluding header row) of table before starting a new slide for additional data. This implicitly sets #allowGrowth.

Available in ppt reporting only!

Parameters:
Name Type Description
rows number

Maximum number of data rows per slide. Has to be greater than 0.

The component itself.

withMaximumHeightPerSlide(height) → {TableComponent}

Set maximum height of table before starting a new slide for additional data. This implicitly sets #allowGrowth and resets #withMaximumDataRowsPerSlide so that height is taken into account instead of number of rows. Please note that at least one data row is added per slide, even if adding this one row will cause the table height to exceed the maximum height set here.

Available in ppt reporting only!

Parameters:
Name Type Description
height number

The maximum table height in pt. Has to be greater than 0.

The component itself.

withNumberOfTemplateRows(rows)

Sets the number of actual table rows per data set. Use this if data sets need more than one row for representation. Each call of #addRow will clone the given amount of rows from the template.

Available in ppt reporting only! In word reporting this is controlled by the placement of the RepeatStart/End placeholders.

Parameters:
Name Type Description
rows number

Number of rows

withX(xPosition) → {Component}

Sets the x coordinate of the component on the slide where 0 represents the leftmost border of the visible area. Values may exceed the boundaries (negative & positive) which will result in the component being placed outside the viewport.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
xPosition number

The x coordinate of the component. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component

withY(yPosition) → {Component}

Sets the x coordinate of the component on the slide where 0 represents the topmost border of the visible area. Values may exceed the boundaries (negative & positive) which will result in the component being placed outside the viewport.

The used unit may depend on the report type. PowerPoint eg. uses "pt" as the default unit (where 1 pt usually ≈1 in).

Available in ppt reporting only!

Parameters:
Name Type Description
yPosition number

The y coordinate of the component. Set to null to unset and use presentation settings.

Inherited From:

The component itself.

Component