TX Text Control .NET for Windows Forms Documentation

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
DocumentServer.MailMergeInitializes a new instance of the MailMerge class.

Properties

PropertyDescription
RemoveEmptyFieldsSpecifies whether empty fields should be removed from the template or not.
RemoveTrailingWhitespaceSpecifies whether trailing whitespace should be removed before saving a document.
SearchPathSpecifies a directory name where sub-templates and images (for image merging) should be searched.
TextComponentGets or sets the TextComponent object of type ServerTextControl that is associated with the DocumentServer.MailMerge component.
UseTemplateFormatSpecifies whether the template page size and margins should be used or not.

Methods

MethodDescription
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.
MergeMerges the loaded template with the data of a specific System.Data.DataTable. The second parameter specifies whether the single documents should be merged into one document or splitted into separate documents.
MergeBlocksMerges all repeating blocks that are contained in the loaded template with the System.Data.DataTable instances contained in the given System.Data.DataSet. The name of the
PrintPrints the merged document.
SaveDocumentSaves the merged document to a file.
SaveDocumentToMemorySaves the merged document to a byte array or as a string.

Events

EventDescription
BlockRowMergedOccurs when a merge block row 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.
IncludeTextMergingOccurs when an IncludeText field has been merged.

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now