officefileapi-devexpress-dot-spreadsheet-dot-iworkbook-fd948bf9.md
Specifies the data source for the mail merge.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
object MailMergeDataSource { get; set; }
Property MailMergeDataSource As Object
| Type | Description |
|---|---|
| Object |
An object that specifies the data source from which the merged data is retrieved.
|
Any object implementing the IList interface can serve as the data source for the spreadsheet mail merge. Assign the data source object to the MailMergeDataSource property of the mail merge template workbook.
When connecting to a data source that contains multiple data tables, specify the required data member using the IWorkbook.MailMergeDataMember property. See the How to: Perform a Mail Merge example for details.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MailMergeDataSource property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheet-mail-merge/CS/DXApplication1/Form1.cs#L24
template = spreadsheetControl1.Document;
template.MailMergeDataSource = dataSet;
template.MailMergeDataMember = "Categories";
winforms-spreadsheet-mail-merge/VB/DXApplication1/Form1.vb#L24
template = spreadsheetControl1.Document
template.MailMergeDataSource = dataSet
template.MailMergeDataMember = "Categories"
See Also
Mail Merge in WinForms Spreadsheet Control