Dynamic Tables

Dynamic tables are called dynamic because the column width automatically changes based on the content of each column and allow column cells to span rows.

Dynamic tables are implemented as an extension of the existing Table element. To make a table dynamic, select the Dynamic Layout property.

To allow the report engine to dynamically compute the column width, do not set the Fix Width or Proportional Width properties on column definitions. The report engine will compute the optimal size for each column in the table based on the size requirements of the column content.

Important:

The column properties Fix Width and Proportional Width, if set, will always be applied, even if the table has the Dynamic Layout property selected.

Dynamic tables are fully backward compatible; any rendering using a non-dynamic table can be achieved with a dynamic table.

A row cannot exceed the height of a page.

Cells that span multiple rows

Dynamic tables have a Row Span property on column elements. This property is useful for creating grouped or hierarchical data presentations where a single cell spans multiple rows. For more information, go to Row Span.

Latency and memory consumption considerations

Dynamic tables do not stream their content; the entire table must be computed and held in memory before rendering. This is necessary because the last row may contain the widest column content, affecting column width calculation. If a table spans multiple pages, the first page is rendered only after the last row is processed.

Cascading attributes

A non-dynamic table has limitations when setting properties; not all attributes can be set on every structural element. Dynamic tables do not have this limitation; the setting of properties will cascade down the table structure hierarchy.

The priority is as follows:
  1. If the property is set on a column (Type of "Col"), it is used, otherwise
  2. If the property is set on the row (Type of "Row"), it is used; otherwise
  3. If the property is set on the column definition (Type of "Coldef"), it is used; otherwise
  4. If the property is set on a section (Type of "Head", "Body", or "Foot"), it is used; otherwise
  5. The setting for the table (Type of "Table") is used.

For example, if a row sets the Size (fontSize) property to "15" and a column inside the row sets the Size (fontSize) property to "12", the column which set the attribute will have a font size of 12 and the remaining columns will have a font size of 15. Any other rows will have the default font size, unless they also set the Size (fontSize) property.

Example

The Reports demo includes a report design documents showing reports that include a table element:
  • The DynamicTableInvoice.4rp shows a report that implements a dynamic table.