Table Elements
  • 18 Sep 2024
  • 10 Minutes to read
  • Dark
    Light

Table Elements

  • Dark
    Light

Article summary

General

Table report element can be used to export data in tabular form into the Template.

General Properties

This type of report element has the following general properties:

Name

Description
NameThe name of the table element. This name will be displayed in the tree hierarchy of the content explorer of the Report Designer.
CodeThe code of the table element. There must be no other report element within the same report with the same code. The code is used to reference the report element from within a Template (see below).
ConditionAn optional condition Expression; if it returns True or 1 the condition is considered to be fulfilled and the table will be included in the report document. If it returns something other than True or 1 the exclusion settings (see below) will be applied. If you leave this property empty, the condition is considered to be always fulfilled. The condition expression is evaluated after the preparation Actions of the table element have been executed.
Preparation ActionsA list of Actions that will be executed before the table element will be processed.
Fail On Filter ExceptionDetermines what shall happen if an exception occurs when executing a preparation action that performs a filter (e.g. because the value to which you want to filter does not exist). When enabled, an exception will be thrown and the report document creation will be cancelled; when disabled, the exclusion settings (see below) will be applied.
Source

Datasource Object. When selecting this option, the table will be extracted from a datasource object (i.e. the visualization of a Qlik datasource or the table or view of an SQL Datasource.

SQL Query. When selecting this option, the table will be extracted from the result of an SQL query executed in an SQL Datasource. In that case any filters set (i.e. using Filter Datasource Field Action) will be ignored and the direct result of the SQL query will be used.
Datasource ObjectThe Datasource object from which the data shall be extracted. This property is only applicable if the

Source is

Datasource Object.
SQL DatasourceThe SQL Datasource in which to execute the SQL query. This property is only applicable if the

Source is

SQL Query.
SQL QuerySQL Query
Include HeaderWhen enabled, the table header will be included in the export. This property is not applicable in all scenarios and not all Datasource objects support headers.
Include TotalsWhen enabled, the grand totals of the table will be included in the export. This property is not applicable in all scenarios and not all Datasource objects support grand totals.
Null ValueAn Expression that evaluates to the representation of null values in the table. When left empty, null values will be represented with a blank.
TransposeWhen enabled, the table will be transposed (rows will become columns and columns will become rows). The transposition takes place after the

Include Header,

Include Totals, and

Column Selector properties have been applied but before styles, column widths, and row heights are applied.
Column Selector

All Columns. When you select this option, all columns of the source table will be included in the exported table.

Include Specified. If you select this option only columns specified in the Column Numbers property (see below) will be included in the exported table.

Exclude Specified. If you select this option all columns of the source table will be included in the exported table except for those specified in the Column Numbers property (see below).
Column NumbersAn Expression that returns one or more column numbers. This property is only applicable if the

Column Selector property is set to something other than All Columns.

When the column selector is set to

Include Specified, the expression needs to return one or more column numbers in the order in which they shall be included in the exported table.

If the selector is set to

Exclude Specified, the expression needs to return one or more column numbers to be excluded from the table.
Width TypeThis property is not available in all configurations.

Do Not Set. When selecting this option, column widths of the exported table will not be set.

Automatic. When selecting this option, column widths will automatically be adjusted to fit contents.

Pixels. When selecting this option, column widths will be set to pixels returned by the

Column Width(s) property.

Percentages. When selecting this option, column widths will be set to percentages returned by the

Column Width(s) property.

Keep Original. If you choose this property, the original column widths will be kept. This option is not available for all Datasource objects.
Width(s)An Expression that returns a single Number or a List of numbers that represent column widths. The unit of each value depends on the Width Type property. If there are more columns in the table than column widths provided, the last provided column width will be applied to the remaining columns. This property is only applicable if the Width Type property is set to Pixels or Percentages.
Row Height TypeThis property is not available in all configurations.

Do Not Set. When selecting this option, row heights of the exported table will not be set.

Automatc. When selecting this option, row heights will automatically be adjusted to fit contents.

Pixels. When selecting this option, row heights will be set to pixls returned by the Row Height(s) property.

Keep Original. If you choose this property, the original row heights will be kept. This option is not available for all Datasource objects.
Height(s)An Expression that returns a single Number or a List of numbers that represent row heights in pixels. If there are more rows in the table than row heights provided, the last provided row height will be applied to the remaining rows. This property is only applicable if the Height Type property is set to Pixels.
Styling ModeThis property is not available in all configurations.

Do Not Set. When selecting this option, no style will be applied to the exported table.

Keep Original. When selecting this option, the style of the exported table will be kept as close as possible to the original style of the Datasource object.

Custom. When selecting this option, you can specify custom style settings which will be applied for all Table Cell Types.

Custom Per Cell Type. When selecting this option, you can specify individual style settings for every Table Cell Type.
Custom StyleThis property is not available in all configurations. If the property Styling Mode is set to Custom Per Cell Type there will be one property per Table Cell Type.

Do Not Set. When selecting this option, no style will be applied to the exported table.

Keep Original. When selecting this option, the style of the exported table is as close as possible to the original style of the Datasource object.

Custom. When selecting this option, you can specify a custom Table Cell Style.

Global Style. When selecting this option, you can select a Global Style to apply.
Exclusion Behavior

Exclude Element. When choosing this option and the table element needs to be excluded, the table will simply be ommitted from the output and an optional replacement text (see below) may be inserted.
Replacement TextAn optional Expression that evaluates to a string that contains the replacement text to insert into the report document when the expression element needs to be excluded (e.g. if the condition is not fulfilled).

Insertion

You can insert the placeholder for the table element by dragging and dropping the report element from the content explorer of the Report Designer into the template. You will then see a placeholder within the template with the following syntax:

Table Element Placeholder

%%<code>%%

NOTE

If you change the code of a table element after you have inserted the placeholder into the template, you need to change the placeholder in the template as well. Otherwise error messages will occur when creating the report document.

Cell Settings

These settings can be used to manipulate properties of cells of the exported table. Every table report element has Default settings and (optionally) a number of custom cell settings. For every cell of the exported table, the applicable cell settings are evaluated; if custom cell settings are found, they are applied, otherwise the default settings are used.

NOTE

Only the first cell settings whose selector fits a cell will be applied to that cell (even if subsequent cell settings may also apply); cell settings are never combined.

Default Settings

The default cell settings are applied to all cells for which no custom cell settings have been found. They have the following properties:

Name

Description
Custom ValueWhen enabled, you can specify an Expression that may be used to override the value of the cell. The expression needs to return the effective value of the cell. See below to see available expression parameters for this expression.
Style Application ModeDo Not Set. When selecting this option, no style properties will be set for applicable cells.

Keep Original. When selecting this option the style of applicable cells will be as close as possible to the source table.

Custom. When selecting this option, a button will appear that allows you to specify custom style settings for applicable cells.

Global Style. When selecting this option you can select a Global Style to apply to applicable cells.

Please not that styling is not always available.

Custom Settings

You can specify zero or more custom cell settings which will be used with a higher priority than the default cell settings. Custom cell settings have the following additional properties:

Name

Description
NameThe name of the custom cell settings.
Cell SelectorDepending on Cell Type. If you select this option, you can select Table Cell Types to which the custom settings apply.

Depending on Column Number. If you select this option, you can specify a range of column numbers (starting with 1) for which the custom settings apply.

Depending in Column Number and Cell Type. If you select this option, you can specify a range of column numbers (starting with 1) and Table Cell Types. Only cells for which both conditions apply are affected.

Depending on Row Number. If you select this option, you can specify a range of row numbers (starting with 1) for which the custom settings apply.

Depending on Row Number and Cell Type. If you select this option, you can specify a range of row numbers (starting with 1) and Table Cell Types. Only cells for which both conditions apply are affected.

Depending on Row and Column Number. If you select this option, you can specify a range of row numbers (starting with 1) and column numbers (starting with 1) to which the custom settings apply.

Depending on Custom Condition. If you select this option, you can specify a custom condition Expression; the custom settings are applied to all cells for which the condition returns True or 1. See below for available expression parameters.

Expression Parameters

These are the available expression parameters for custom cell value and condition Expressions of cell settings:

Name

Description
CellValueThe value of the cell for which the cell settings are evaluated.
CellTypeThe Cell Type of the cell for which the cell settings are evaluated.

0. DataTopHeader
1. TotalsTopHeader
2. SubTotalsTopHeader
3. DataLeftHeader
4. TotalsLeftHeader
5. SubTotalsLeftHeader
6. Data
7. Total
8. SubTotal.
9. Filler
ColumnNumberThe column number of the cell for which the cell settings are evaluated (the first column has column number 1).
The column number of the cell for which the cell settings are evaluated (the first column has column number 1).True if the value of the cell for which the cell settings are evaluated is numeric, otherwise False.
RowNumberThe row number of the cell for which the cell settings are evaluated (the first row has row number 1).

Example 1

Let's suppose you only have default cell settings (i.e. no custom cell settings) and you have the following custom value expression set up:

Custom Value Expression

If([ColumnNumber]=1 And [RowNumber]=2, "Hello World", [CellValue])

Since there are no custom cell settings, the default settings are applied to all cells of the table. The custom value expression leads to the cell in the first column and second row to have the text Hello World; all other cells with keep their original value (defined by the [CellValue] expression parameter).

Example 2

Let's suppose you have custom cell settings with a selector Depending on Column Number and a column number range of 1 to 3 where the style application mode is set to Custom and the Bold style property of the custom style is set to Yes. The default settings have a style application mode of Keep Original. In that case, all cells to which the custom cell settings apply (all settings in the 1st to 3rd column) will have a bold text. All other cells will keep their original style, because the default cell settings are applied.

NOTE

Different cell settings are never combined; only the first cell settings whose selector targets a particular cell will be applied to that cell.


Was this article helpful?

What's Next