MailMerge: Merge, MergeObject and MergeObjects - When to Use What?
The MailMerge class has three methods to start the merge process. This article explains when to use which method. 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. MergeObject…

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
This article explains the different settings of the MailMerge class and how and when they should be used.
Merge Excel Documents into MailMerge Templates using IncludeText Fields
This sample shows how to use IncludeText fields to merge Excel documents into templates using MailMerge.
MailMerge: Conditional Table Cell Colors using Filter Instructions
The MailMerge class provides an extensible framework to inject custom logic to the merge process. This sample shows how to implement conditional table cell colors.
MailMerge: Using Filters to Remove Unwanted Rows
Data in merge blocks can be filtered and sorted. This article explains how to use filters to remove unwanted lines.
ReportingWindows FormsMail Merge
MailMerge: Conditional Rendering of Merge Blocks
Merge blocks can be used to render content conditionally. This article explains different ways to control this.