Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Spreadsheet Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Printing
    Events
   [Collapse]Mail Merge Overview
     Mail Merge Ribbon Tab
     Mail Merge Design View
     Field List Panel
     Parameters Panel
     Data Source Wizard
     Mail Merge Functions
     Template Document
    Protection
    Find and Replace
   [Expand]Visual Elements
    Services
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Mail Merge Overview

The Mail Merge functionality enables you to automatically generate a set of documents based on a single template and include unique data values retrieved from a data source into each document. This feature can be useful for a variety of business requirements, such as personalizing letters, and composing catalogs and reports.

This document contains an overview of the mail merge process and lists special mail merge tools provided by SpreadsheetControl.

Expanded Mail Merge Process

To perform a mail merge, you need a template and a data source.

  • A template is a document containing placeholders for the information that will be merged from a data source (mail merge fields). See the Template Document topic to learn more about mail merge templates.
  • A data source contains data that will be merged into fields in a template to create merged documents. A data source can be any object that exposes the IList interface, such as a System.Collections.ArrayList or a System.Data.DataTable. So, you can create a mail merge data source at runtime, or retrieve data from an external database via corresponding data adapters.

    The data source is bound to the template via the IWorkbook.MailMergeDataSource and IWorkbook.MailMergeDataMember properties of the template workbook.

    Note

    Loading the mail merge templates with the ObjectDataSource data source may be unsafe if the data source is contained in a compiled assembly. Use the SpreadsheetControlOptions.DataSourceOptions property and a custom service that implements the IObjectDataSourceValidationService interface to validate an ObjectDataSource contained in the loaded document and prevent the data source from loading.

The IWorkbook.GenerateMailMergeDocuments method of the template workbook finalizes the mail merge process. It returns a collection of resulting workbooks (if the Single Sheet or Multiple Sheets mail merge mode is used, the collection will contain a single workbook). You can open the resulting workbook in a SpreadsheetControl instance, or save it to a file or stream.

The Mail Merge section contains step-by-step tutorials on how to use the SpreadsheetControl's mail merge functionality.

Expanded SpreadsheetControl's Mail Merge Tools

SpreadsheetControl provides a set of easy-to-use tools allowing your end-users to visually design templates and preview mail merge results on-the-fly.

Expanded See Also

How would you rate this topic?​​​​​​​