Typically, a merge block is used to repeat content such as table rows. The MailMerge TX Text Control .NET Server for ASP.NET
DocumentServer Namespace
MailMerge Class
The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services.
class is using the hierarchical data to repeat the content and to populate fields with data in that block. This merge block provides 3 different options that can be controlled:

  • Filters
  • Sorting
  • Rendering conditions

Those options can be defined through a dialog box or when adding a merge block programmatically through the MergeBlockInfo TX Text Control .NET Server for ASP.NET
DocumentServer.DataSources Namespace
MergeBlockInfo Class
The MergeBlockInfo class is used to insert a table or paragraph based repeating merge block into a TextControl instance using the DataSourceManager.InsertMergeBlock method.
class.

MergeBlockInfo Class

An extension in version X19 provides a way to create a MergeBlockInfo instance based on an existing merge block SubTextPart TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
SubTextPart Class
A SubTextPart object represents a user-defined part of a TX Text Control document.
.

Consider the following JSON string as the data source:

Loading...

The following screenshot shows a nested merge block including the blocks items and location:

Merge Blocks

The inner merge block location should be only rendered, if the id of the parent block (items) is > 1.

Manipulate MergeBlock Conditions

The following code shows how to retrieve a SubTextPart and to create a new MergeBlockInfo object to apply the required merge condition:

Loading...

When the template is merged using MailMerge, you can see that the first inner merge block is not merged while the other 2 blocks are merged as they match the condition (id > 1):

Merge Blocks

Stay tuned for more improvements and new features of TX Text Control X19!