TX Text Control .NET Documentation

TXTextControl.DocumentServer.MailMerge Class

The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services. The MailMerge class can be found in the TXTextControl.DocumentServer namespace. It is inherited from the System.ComponentModel.Component class. The following describes only the properties and methods defined through the MailMerge class. For a list of properties, methods and events inherited from the System.ComponentModel.Component class see the .NET Framework reference.

Introduced: 14.0.

Syntax

[C#] public class MailMerge : Component
[Visual Basic] Public Class MailMerge Inherits Component

Constructors

ConstructorDescription
MailMergeInitializes a new instance of the MailMerge class.

Properties

PropertyDescription
MergeBlockNamePrefixA static property returning the internal merge block name prefix "txmb_".
RemoveEmptyBlocksSpecifies whether the content of empty merge blocks should be removed from the template or not.
RemoveEmptyFieldsSpecifies whether empty fields should be removed from the template or not.
RemoveEmptyImagesSpecifies whether images which don't have merge data should be removed from the template or not.
RemoveTrailingWhitespaceSpecifies whether trailing whitespace should be removed before saving a document.
ReportDataSourceConfigSpecifies the Report Data Source Configuration as an XML string.
ReportDataSourceConfigFileGets or sets the file path of a Report Data Source Configuration file (*.rdsc) which has been created with TX Text Control Words.
SearchPathSpecifies a directory name where sub-templates and images (for image merging) should be searched.
TemplateFileSpecifies the template file path.
TextComponentGets or sets the TextComponent object which is associated with the MailMerge component.
UseTemplateFormatSpecifies whether the template page size and margins should be used or not.

Methods

MethodDescription
GetBlockFieldNamesReturns the names of all merge fields inside the merge block with the specified name.
GetBlockNamesLists the names of all merge blocks contained in the currently loaded template.
LoadTemplateLoads a template from a file that is used for the merge process.
LoadTemplateFromMemoryLoads a template from memory that is used for the merge process.
MergeOverloaded. Merges given data into the loaded document template.
MergeBlocksMerges all repeating blocks that are contained in the loaded template with the System.Data.DataTable instances contained in the given System.Data.DataSet.
MergeJsonDataOverloaded. Merges data given as a JSON string into a document template.
MergeObjectMerges a single instance of an arbitrary type into the loaded document template.
MergeObjectsOverloaded. Merges a collection of type System.Collections.IEnumerable containing objects of any type or instances of type System.Collections.Generic.Dictionary with string keys into the loaded document template.
PrintOverloaded. Prints the merged document.
SaveDocumentSaves the merged document to a file.
SaveDocumentToMemoryOverloaded. Saves the merged document.

Events

EventDescription
BarcodeMergedOccurs when a barcode has been merged successfully.
BlockMergingOccurs when a merge block is about to be merged.
BlockRowMergedOccurs when a merge block row has been merged successfully.
ChartMergedOccurs when a chart has been merged successfully.
DataRowMergedOccurs when a data row has been merged successfully.
FieldMergedOccurs when a field has been merged.
ImageFieldMergedOccurs when an image field, i.e., a merge field whose name is prefixed with "image:" has been merged.
ImageMergedOccurs when an image has been merged successfully.
IncludeTextMergingOccurs when an IncludeText field has been merged.

See Also

 
 
Call us: +1 704-544-7445 (United States)
 
 

Products

Support

Downloads

Corporate

Buy Now

About Text Control

Founded in 1991, Text Control is an award-winning Visual Studio Industry Partner and leading vendor of word processing and reporting components for Microsoft development technologies. The products help thousands of developers add comprehensive word processing functionality to their applications. Text Control is 100% self-owned and independent of all investor decisions. Customers benefit from these years of experience, large user-base, and at the same time, appreciate developing with a mature, reliable product.

SD Times 100SD Times 100SD Times 100SD Times 100SD Times 100SD Times 100Visual Studio 2015 Launch PartnerVisual Studio 2013 Launch PartnerVisual Studio 2012 Launch PartnerVisual Studio Partner