How can you group table data in an Apsona merge template based on a field, and what are the limitations of grouping?

Apsona allows you to group rows within a table using the GroupHeader merge field. This is useful when you want to organize records by a specific field (such as Category, Department, or Project Type) and calculate aggregates for each group.

To group records, insert the following merge field in the template:

«GroupHeader:GroupName:FieldName»

Where:

  • GroupName is a unique name that identifies the grouping.

  • FieldName is the field whose values will be used to group the records.

For example, to group project specifications by Category, you can use a GroupHeader that references the Category field. Apsona will then organize the table into separate sections for each category.

When using grouping, keep the following behaviors and limitations in mind:

  • Each grouping must use a unique group name. If multiple GroupHeader fields are used in the same template, they cannot share the same group name.

  • The GroupHeader merge field should always be placed in the first row of the table, before the TableStart field. If it is placed elsewhere, the records will still be grouped correctly, but the group header itself will not be displayed.

  • If an aggregate field (such as Sum) is placed at the end of the table, Apsona calculates the aggregate separately for each group, rather than across the entire table.

  • The GroupHeader feature does not support calculating a grand total across all groups. It only provides aggregates at the individual group level.

Grouping is an effective way to organize table data and display per-group totals, but it cannot be used to calculate an overall total for the entire table.