Back to Devexpress

IWorkbook.MailMergeDataSource Property

officefileapi-devexpress-dot-spreadsheet-dot-iworkbook-fd948bf9.md

latest3.4 KB
Original Source

IWorkbook.MailMergeDataSource Property

Specifies the data source for the mail merge.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
object MailMergeDataSource { get; set; }
vb
Property MailMergeDataSource As Object

Property Value

TypeDescription
Object

An object that specifies the data source from which the merged data is retrieved.

|

Remarks

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

csharp
template = spreadsheetControl1.Document;
template.MailMergeDataSource = dataSet;
template.MailMergeDataMember = "Categories";

winforms-spreadsheet-mail-merge/VB/DXApplication1/Form1.vb#L24

vb
template = spreadsheetControl1.Document
template.MailMergeDataSource = dataSet
template.MailMergeDataMember = "Categories"

See Also

Mail Merge in WinForms Spreadsheet Control

WinForms Spreadsheet Control Examples

IWorkbook Interface

IWorkbook Members

DevExpress.Spreadsheet Namespace