The MailMerge class has three methods to start the merge process. This article explains when to use which method.

Merge

The method Merge has four implementations and is basically used when merging a template with a DataSet or a data source configuration file. When merging with a DataSet, the master table is passed in the mergeData parameter.

The master table is used as the base table and all related tables are automatically used for merge blocks and prefixed merge field names.

Loading...

MergeObject

MergeObject has been introduced in version X13 (23.0) to merge all types of business objects of type IEnumerable. While MergeObjects (plural) merges a collection of IEnumerable objects, MergeObject merges a single instance of an arbitrary type into the loaded document template.

MailMerge interprets all public properties of the object as table columns and child tables. The object type is analyzed using .NET reflection and used as the basis of the table structure. Nested object types are used for merge blocks and prefixed merge fields.

Loading...

MergeObjects

This method merges a collection of type IEnumerable into the template. For each object in the collection, a new document is created or appended to the resulting document.

Loading...