MailMerge: Merge, MergeObject and MergeObjects - When to Use What?
The MailMerge class provides three merge methods. Merge accepts a DataSet or configuration file with a master table and related sub-tables. MergeObject merges a single business object using .NET reflection on its public properties. MergeObjects processes an IEnumerable collection.

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.
public void Merge(System.Data.DataTable mergeData, bool append);
public void Merge(System.Data.DataTable mergeData);
public void Merge(bool append);
public void Merge();
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.
public void MergeObject(object mergeData);
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.
public void MergeObjects(System.Collections.IEnumerable mergeData, bool append);
public void MergeObjects(System.Collections.IEnumerable mergeData);Reporting
The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.
Related Posts
MailMerge Class Settings Explained
The MailMerge class provides four properties to control merge output: RemoveEmptyFields, RemoveEmptyLines, RemoveEmptyBlocks, and RemoveEmptyImages. Each property handles unmatched or missing data…
Merge Excel Documents into MailMerge Templates using IncludeText Fields
IncludeText fields in TX Text Control templates reference external Excel files during mail merge. The process loads .xlsx files as temporary ServerTextControl instances, using Bookmark to target…
MailMerge: Conditional Table Cell Colors using Filter Instructions
The TX Text Control MailMerge FieldMerged event exposes TableCell instances during merge for conditional formatting. A CellFilterInstructions class parses filter rules from merge field names and…
MailMerge: Using Filters to Remove Unwanted Rows
TX Text Control merge block filters remove unwanted rows from repeating data during the mail merge process without modifying the underlying source. Filter conditions applied to merge blocks…
ReportingWindows FormsMail Merge
MailMerge: Conditional Rendering of Merge Blocks
TX Text Control X16 provides two approaches to conditionally render merge blocks within MailMerge templates. Setting RemoveEmptyBlocks removes blocks when child data is absent, while…
