When using table headers and repeating blocks in combination in a MailMerge process, there are some things you need to know before creating your templates.
A table header can consist of n number of rows in a table that get repeated as header rows at the top of each page when tables break across pages. The following screenshot shows a repeated table header:
Repeating blocks or merge blocks is a very flexible feature within Text Control Reporting. The content of a block is repeated based on the number of data rows that are passed in the merge process. Generally, a block can repeat anything: A table row, a complete table, paragraphs or a single word. All break characters are repeated and applied automatically. The following screenshot shows a merge block in a template. The highlighted area in red defines the repeating block.
After merging data into the template, the merge block is perfectly repeated:
A merge block can be part of a table that has a table header that gets repeated automatically when a table breaks across pages. As you can see in the sample template above, the second table row (highlighted in red) represents the merge block. The block is part of a table that has been created with a repeating table header. This table header is valid for the complete table and is repeated for each page the table is extended to.
The table header can contain merge fields from the master table or related tables.
It is also possible to include the table header into the merge block in order to insert the block data merge fields into the table header.
Now, consider a nested merge block that contains block data in a table header:
In this case, you have to be careful with the merge block setup. As the outer table is expanded over pages, it will have a static table header with the same content for all pages. In the results, you can see that the header on the second page still reads status AA, even if the data rows are already coming from the third merge block CC.
In order to solve this issue, the complete table should be embedded into the block. Each block table has it's own table header, in case a block table breaks across pages.