Table element
Repeats rows over a secondary dataset (invoice lines, order items). Inside the table, bare names resolve to the table’s row first and then to the enclosing body row; aggregates in the footer default to the table’s rows.
- { type: table, dataset: ..., columns: ... }Example
Section titled “Example”title: Order linesculture: en-USstyles: header: { fontWeight: bold, borderBottom: "0.75pt solid #000000", padding: 2pt 0 }data: lines: { fields: { Product: string, Quantity: int32, Price: decimal } }body: reportHeader: - content: - type: table dataset: lines sort: [Product] headerStyle: header columns: - { header: Product, value: "{Product}", width: 3fr } - { header: Qty, value: "{Quantity}", width: 1fr, align: end } - { header: Price, value: "{Price:C}", width: 1fr, align: end } - { header: Amount, value: "{Quantity * Price:C}", width: 1fr, align: end } footer: - borderTop: "0.75pt solid #000000" cells: - { value: Total, span: 3, fontWeight: bold } - { value: "{Sum(Quantity * Price):C}", fontWeight: bold, align: end }data: lines: - { Product: Support contract, Quantity: 1, Price: 480.00 } - { Product: Consulting (hours), Quantity: 12, Price: 95.00 } - { Product: Training day, Quantity: 2, Price: 650.00 }
Properties
Section titled “Properties”dataset
Section titled “dataset”Type: text · Required
The dataset whose rows the table repeats.
filter
Section titled “filter”Type: expression
Row filter; may reference the enclosing row, e.g. =InvoiceId == Parent.Id.
Type: list of sort key
Row order.
columns
Section titled “columns”Type: list of object · Required
The columns: header, value and width.
showHeader
Section titled “showHeader”Type: true or false · Default: true
Shows the row of column headers.
repeatHeader
Section titled “repeatHeader”Type: true or false · Default: true
Repeats the header row on every page the table continues onto.
headerStyle
Section titled “headerStyle”Type: text
A named style for the header row.
headerStyleFrom
Section titled “headerStyleFrom”Type: object
Style properties for the header row taken from the data (parameters, variables), over its named style.
before
Section titled “before”Type: list of object
Rows between the column headers and the data rows, such as an opening balance. They see the first data row, as footer rows see the last, and the table’s totals.
detail
Section titled “detail”Type: list of object
The rows each data row shows, in place of the columns’ values: for a record that takes more than one row (a line and its description under it), or cells that span columns.
groups
Section titled “groups”Type: list of object
Groups of the data rows, outermost first: runs of consecutive rows with the same key (sort by the keys first), each with rows before and after it, such as a heading and a subtotal.
footer
Section titled “footer”Type: list of object
Rows after the data rows, such as totals.
emptyText
Section titled “emptyText”Type: text
Text shown instead of the body when there are no rows.
columns
Section titled “columns”Each entry of columns. Columns also have the style properties, which apply to their data cells.
Type: text
A named style for the column’s data cells.
header
Section titled “header”Type: text
Header text (template). Becomes a TH cell in the structure tree. Like the rows before the data, it sees the table’s first row, and its aggregates cover the table’s rows: "{Count()} orders".
headerContent
Section titled “headerContent”Type: list of element
Elements the header cell holds instead of its text: texts side by side in a row, say. They are laid out at the column’s width, with the values the header sees, as a cell’s content is.
Type: text
Cell text (template), evaluated for each row. Required, unless the table has detail rows.
visible
Section titled “visible”Type: expression
Shows the cell’s text only where this is true; elsewhere the cell is empty, and keeps its width and borders.
Type: length · Default: 1fr
Column width: pt (or another unit), %, fr (a share of the width left) or auto (as wide as its content).
Type: list of object
Styles for the column’s data cells that apply, row by row, where their condition holds.
styleFrom
Section titled “styleFrom”Type: object
Style properties for the column’s data cells taken from each row, e.g. background: =RowColor.
markup
Section titled “markup”Type: keyword · Default: none
Reads the data cells’ text as HTML (see the text element’s markup).
One of:
none: As it is: every character is shown.html: As a small subset of HTML, once its expressions are filled in:b,strong,i,em,u,s,br, paragraphs anddivs, lists, headings (in bold),font color, and thecolor,font-weight,font-styleandtext-decorationof astyleattribute. Spaces collapse, and entities such as&are read. Other tags are left out, with their text kept; font sizes and faces are not used.
groups
Section titled “groups”A group of a table’s data rows: a run of consecutive rows with the same key. Its header rows see its first row, its footer rows its last, and aggregates in them cover the group. Each entry of groups, outermost first. In a group’s header and footer rows, an aggregate without a scope covers the group; elsewhere in the table, the table.
Type: text · Required
Also the name by which the table’s rows read the current group key, and the aggregate scope.
Type: expression · Required
The group key: a new group starts where it changes.
header
Section titled “header”Type: list of object
Rows before each group’s rows, such as a heading.
footer
Section titled “footer”Type: list of object
Rows after each group’s rows, such as a subtotal.
footer rows
Section titled “footer rows”Each entry of before (rows between the header and the data, which see the first data row), of detail (the rows each data row shows), of footer (rows after the data, which see the last), and of a group’s header and footer, with the style properties too.
Type: text
A named style for the row.
visible
Section titled “visible”Type: expression
Leaves the row out where this is false.
Type: list of object · Required
The cells, left to right (right to left in rtl text).
footer cells
Section titled “footer cells”Each entry of a row’s cells, with the style properties too.
Type: text
A named style for the cell.
Type: text
Cell text (template).
visible
Section titled “visible”Type: expression
Shows the cell’s text or content only where this is true; elsewhere the cell is empty, and keeps its width and borders.
content
Section titled “content”Type: list of element
Elements the cell holds instead of text: an image, a subreport, a stack of texts. They are laid out top to bottom at the cell’s width, with the row’s values, as a band’s elements are. Tables, matrices and charts cannot be nested in a cell.
Type: whole number · Default: 1
The number of columns the cell covers.
isHeader
Section titled “isHeader”Type: true or false · Default: false
Marks the cell as a row header (TH with Row scope) for tagging.
Type: list of object
Styles that apply where their condition holds, e.g. a negative amount in red.
styleFrom
Section titled “styleFrom”Type: object
Style properties taken from the data, e.g. color: =StatusColor.
markup
Section titled “markup”Type: keyword · Default: none
Reads the cell’s text as HTML (see the text element’s markup).
One of:
none: As it is: every character is shown.html: As a small subset of HTML, once its expressions are filled in:b,strong,i,em,u,s,br, paragraphs anddivs, lists, headings (in bold),font color, and thecolor,font-weight,font-styleandtext-decorationof astyleattribute. Spaces collapse, and entities such as&are read. Other tags are left out, with their text kept; font sizes and faces are not used.
It also has the properties of every element and the style properties.