This blog article outlines how to group tables in DocumentsCorePack (.docx) templates. Grouping a table allows you to separate the line items within the table by a specific attribute, such as e.g. Product type.
Example: Our Product catalog consists of Product licenses as well as Services. When printing a quote, we want the items to be grouped in separate sections within a table.
Please note: If the grouping headers are displayed repeatedly or are mixed, you need to ensure that the line items are sorted by the grouping attribute. In short, you have to make sure that the grouping field is also the selected sorting field (See this article for details).
If you need more information on creating relationships using the DocumentsCorePack (DCP) TemplateDesigner, have a look at this article.
Step-by-step description
Step 1. After inserting the table into your document, you will have to ensure that ❶ the field you want to group-by has been inserted into the table row. Once done, select the field for grouping. In our example, we use the “Subject”-column of the Product table.
Step 2. Now put the ❶ cursor in the field you want to group and navigate to the Grouping drop-down and select ❷ Mark Grouping field.
More Grouping options:
❶ Mark Groupingfield: This function specifies the selected field as the grouping parameter. The header and Footer to specify details are inserted automatically.
❷ Mark as Sum-Field: This function specifies the selected field as the sum field. This allows e.g. create totals of a group in a table -footer.(See this article for details)
❸ Mark as Count-Field: This function counts, for example, the number of products in a table.
❹ Add Groupingheader: This function adds an additional header.
❺ Remove Groupingheader: This function removes a header you added before.
❻ Add Groupingfooter: This function adds an additional footer.
❼ Remove Groupingfooter: This function removes a footer you added before.
❽ Remove Grouping: This function allows you to remove the entire grouping for a selected table.
Step 3. Once clicked, a ❶ Header and a ❷ Footer row are automatically created. You can change the layout and formatting for your groups.
Step 4. The result.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.