MailMerge: Table Headers and Repeating Blocks
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…

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.
Also See
This post references the following in the documentation:
- TXText
Control. Document Server. Mail Merge Class
Cloud
Are we moving to the cloud? This question is changing from "if" to "when" and "how". Text Control ReportingCloud brings complete reporting functionality to the cloud so all developers can use it, irrespective of the platform or language they're using. Its highly RESTful API can be used to merge Microsoft Word compatible templates with JSON data from all clients including .NET, Javascript, PHP, Node.JS, jQuery, Ruby, Python, Android, Java and iOS.
Related Posts
ReportingCloud: Uploading Templates Vs. Sending Templates Inside MergeBody
Our reporting Web API ReportingCloud provides two different ways to upload templates for merging processes: Upload templates into the template storage in a separate step Upload templates inside…
ReportingCloud: Conditional Text Blocks Based on Merge Blocks
In several applications, it is required to render or to remove a complete text block in a template based on specific conditions. The following screenshot shows a template with a merge block…
Web API Test Sandbox Released on ReportingCloud Portal
We just released a Web API Test Sandbox at the ReportingCloud portal. This sandbox can be used to test Web API calls with your account data and your template storage (so not a completely isolated…
ReportingCloud: New Test Parameter for Document Quota Related Endpoints
The quota related endpoints merge, convert and findandreplace received the new, optional parameter test to send test calls that doesn't count against the document quota. This parameter allows you…
ReportingCloud: The MergeData JSON Object Format Explained
When merging templates with data, a JSON object contains merge data for all merge fields and merge blocks in the document. Using the language specific wrappers, the JSON object is created…