This blog article outlines how to group tables in DocumentsCorePack (.docx) templates. The DocumentsCorePack Grouping functionality gives users the possibility to define an optical sorting and thus, a separation for specific fields.
Please note: If the grouping headers are displayed repeatedly or if they are mixed up, please check the sorting that is set in the RelationshipDesigner. Please make sure that the grouping field is also the selected sorting field.
How to group tables for DocumentsCorePack templates properly:
1) First of all, open Microsoft Word and navigate to www.mscrm-addons.com. Then click on the [Insert MailMerge Fields]-button in order to create your table with DocumentsCorePack, like you can see it below.
Figure 3: DocumentsCorePack table with Insert MailMerge fields
3) Now select the field which you want to define the grouping for. We want to group our table for the row Job. To do so, simply select the field <<jobtitle>> like below.
Figure 4: Selected field for grouping
4) Navigate to www.mscrm-addons .com at the top, and click on the [Grouping]-button. There are some Grouping options, that are explained below. For our example please select Mark Groupingfield.
This option inserts you automatically a header and a footer - in this case, job title, as you can see below.
Figure 6: Insert table header and footer
Mark as Sum-Field
This function sums the entire group. For example: You have two product groups - hardware and software. By selecting this option you can build the sum of e.g. the price of all hardware and all software products.
Mark as Count-Field
This function counts, as the name suggests - in this case e.g. how many people are per job title.
You can add an additional header with more information.
Removes you the before added header.
You can also add an additional footer.
Removes you the before added footer.
This option allows you to remove the entire grouping you´ve made.
6) After defining all your grouping options, you can also change the layout of your table. To do so, select your table and navigate to Design and choose the layout you want - in this case, green. Once you have saved your template and merged it with Dynamics 365 data, the table should look similar to the sample in Figure 7.
As you can see, all contacts with the same job title have been grouped in the same header and footer.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.