Report Template with Variable Set of Columns

Предыдущая страницаВ началоСледующая страница

You can include different sets of columns into a report, using the same template. For this purpose, the template should be created in accordance with following rules:

auto_init = "true" attribute should be assigned to elements of the template. This attribute may also be written shortly - ai.

Columns, whose presence in the report is not mandatory, should be represented in the template by the column containing the {param_name ai/} element in the header and the {param ai/} element in cells, that suppose to contain data from product composition.

The variations table template created in accordance with these rules is supplied with T-FLEX CAD. The content of this template is shown below.

23_ReportVariableColumns

When creating a report by such templates, you should enable the Edited Template and Initialize with Visible Columns checkboxes in parameters of report generator. In result, instead of the {param_name ai/} column, the report will contain all visible columns of product composition, except service columns. The {param_name ai/} element in the header will be replaced by the name of the corresponding product composition column, and the {param ai/} element in other cells will be replaced by the values specified in this column for product composition records.

After creating such report, its set of columns can be edited using the Columns tab of the report parameters dialog.

Report templates with variable set of columns do not allow irregular table headers (see the example below). If you need an irregular header, create a report with a regular header first, then edit its local template using the EditReportTemplate20x20 Edit Report Template command. If you delete or add columns to the report later, the header will be updated incorrectly, so you'll have to edit it manually using the EditReportTemplate20x20 Edit Report Template command again.

23_ReportVariableColumns4

Variations table with irregular header

23_ReportVariableColumns5

Result of Dv and Dm1 columns deletion