With the introduction of objects as an accepted reporting data source, we slightly modified the MailMerge API to reflect these changes. In TX Text Control X10, DataTables, DataSets and all kind of enumerable objects can be used as data sources.

The method MergeBlocks has been deprecated and merged into the Merge or MergeObjects method.

This implies that you don't have to pass data for merge blocks separately. By passing a master table to the Merge method, TX Text Control is getting related tables from the master table's DataSet automatically. To compare this new logic to previous versions, imagine an extra, non-visible repeating block around the whole template that is considered automatically by MailMerge. The following illustration shows the sample invoice template and the different tables:

MailMerge API changes in version X10

Another great advantage of this new concept are prefixed merge field names that use the object-oriented dot notation to describe the path of nested tables. By passing only the master table to the Merge method, a field can refer to a nested table by adding the table path elements divided by a dot as a prefix. The following screenshot shows the new Insert Merge Field dialog that lists all available fields of the master table and related tables of the sample database in TX Text Control Words.

MailMerge API changes in version X10

The inserted field name looks like this:

Customer_Customer.Sales_CustomerAddress.Person_Address.City

Where Customer_Customer is a sub-table of the master table Sales_SalesOrderHeader.

Happy coding!

Try TX Text Control Reporting yourself!
Download the TX Text Control Trial version today.

Download Trial

Or Simply Call Us to Learn More:

United States

+1 704 544 7445 (US)

Europe - Germany

+49 421 427067 10 (Europe)