com.spire.doc.reporting
Class MailMerge

java.lang.Object
  extended by com.spire.doc.reporting.MailMerge

public class MailMerge
extends java.lang.Object


Field Summary
 MergeFieldEventHandler MergeField
          Occurs during mail merge when a text merge field processing.
 MergeGroupEventHandler MergeGroup
          Occurs during mail merge when group/table processing.
 MergeImageFieldEventHandler MergeImageField
          Occurs during mail merge when an image merge field processing.
 
Method Summary
 void execute(DataRow row)
          Performs mail merge from a DataRow into the document
 void execute(DataTable table)
          Performs mail merge from a DataTable
 void execute(java.lang.Iterable dataSource)
          Performs mail merge operation.
 void execute(java.lang.String[] fieldNames, java.lang.String[] fieldValues)
          Performs mail merge operation.
 void executeGroup(MailMergeDataTable dataSource)
          Performs mail merge operation.
 void executeWidthNestedRegion(MailMergeDataSet dataSource, java.util.List<java.util.Map.Entry> filters)
          Performs mail merge operation.
 void executeWidthNestedRegion(java.lang.String xmlFile, java.util.List<java.util.Map.Entry> commands)
          Executes the nested region.
 void executeWidthRegion(DataTable table)
          Performs Mail Merge within a region from a DataTable.
 void executeWidthRegion(java.io.InputStream stream)
          Performs Mail Merge within a region from a DataTable.
 void executeWidthRegion(java.lang.String xmlFile)
          Performs Mail Merge within a region from a DataTable.
 boolean getClearFields()
          Gets or sets a value indicating whether [clear fields].
 boolean getClearGroupTag()
          Gets or sets a value indicating whether [clear group tag].
 boolean getHideEmptyGroup()
          Gets or sets a value indicating whether to remove groups which contain empty merge fields
 boolean getHideEmptyParagraphs()
          Gets or sets a value indicating whether to remove paragraphs which contain empty merge fields
 MailMergeMainDocumentType getMailMergeMainDocumentType()
           
 com.spire.ms.System.Collections.Generic.Dictionary getMappedFields()
          Gets the collection of mapped fields.
 java.lang.String[] getMergeFieldNames()
          Returns a collection of mergefield names found in the document.
 java.lang.String[] getMergeFieldNames(java.lang.String groupName)
          Gets the merge field names.
 java.lang.String[] getMergeGroupNames()
          Gets the merge field names.
 void setClearFields(boolean value)
          Gets or sets a value indicating whether [clear fields].
 void setClearGroupTag(boolean value)
          Gets or sets a value indicating whether [clear group tag].
 void setHideEmptyGroup(boolean value)
          Gets or sets a value indicating whether to remove groups which contain empty merge fields
 void setHideEmptyParagraphs(boolean value)
          Gets or sets a value indicating whether to remove paragraphs which contain empty merge fields
 void setMailMergeMainDocumentType(MailMergeMainDocumentType value)
           
 

Field Detail

MergeField

public MergeFieldEventHandler MergeField
Occurs during mail merge when a text merge field processing.


MergeImageField

public MergeImageFieldEventHandler MergeImageField
Occurs during mail merge when an image merge field processing.


MergeGroup

public MergeGroupEventHandler MergeGroup
Occurs during mail merge when group/table processing.

Method Detail

getClearFields

public boolean getClearFields()
Gets or sets a value indicating whether [clear fields]. by default value is true.

Returns:
true if it clears the fields, set to true.

setClearFields

public void setClearFields(boolean value)
Gets or sets a value indicating whether [clear fields]. by default value is true.


getMailMergeMainDocumentType

public MailMergeMainDocumentType getMailMergeMainDocumentType()

setMailMergeMainDocumentType

public void setMailMergeMainDocumentType(MailMergeMainDocumentType value)

getClearGroupTag

public boolean getClearGroupTag()
Gets or sets a value indicating whether [clear group tag]. by default value is false.


setClearGroupTag

public void setClearGroupTag(boolean value)
Gets or sets a value indicating whether [clear group tag]. by default value is false.


getHideEmptyParagraphs

public boolean getHideEmptyParagraphs()
Gets or sets a value indicating whether to remove paragraphs which contain empty merge fields


setHideEmptyParagraphs

public void setHideEmptyParagraphs(boolean value)
Gets or sets a value indicating whether to remove paragraphs which contain empty merge fields


getHideEmptyGroup

public boolean getHideEmptyGroup()
Gets or sets a value indicating whether to remove groups which contain empty merge fields


setHideEmptyGroup

public void setHideEmptyGroup(boolean value)
Gets or sets a value indicating whether to remove groups which contain empty merge fields


getMappedFields

public com.spire.ms.System.Collections.Generic.Dictionary getMappedFields()
Gets the collection of mapped fields. Mapped fields represent mapping between fields names in the data source and mail merge fields in the document. The keys of the collection are merge field names and the values are field names in the data source.

Returns:
The collection of mapped fields.

execute

public void execute(java.lang.String[] fieldNames,
                    java.lang.String[] fieldValues)
Performs mail merge operation.

Parameters:
fieldNames -
fieldValues -

execute

public void execute(DataRow row)
Performs mail merge from a DataRow into the document

Parameters:
row -

execute

public void execute(java.lang.Iterable dataSource)
Performs mail merge operation.

Parameters:
dataSource - IEnumerable data source

execute

public void execute(DataTable table)
Performs mail merge from a DataTable

Parameters:
table -

executeWidthRegion

public void executeWidthRegion(DataTable table)
Performs Mail Merge within a region from a DataTable.

Parameters:
table -

executeWidthRegion

public void executeWidthRegion(java.lang.String xmlFile)
Performs Mail Merge within a region from a DataTable.

Parameters:
xmlFile - the xml file.
Throws:
java.lang.Exception

executeWidthRegion

public void executeWidthRegion(java.io.InputStream stream)
Performs Mail Merge within a region from a DataTable.

Parameters:
stream - the xml file inputStream.
Throws:
java.lang.Exception

executeWidthNestedRegion

public void executeWidthNestedRegion(MailMergeDataSet dataSource,
                                     java.util.List<java.util.Map.Entry> filters)
Performs mail merge operation.

Parameters:
dataSource - MailMergeDataSet
filters - Commands list

executeWidthNestedRegion

public void executeWidthNestedRegion(java.lang.String xmlFile,
                                     java.util.List<java.util.Map.Entry> commands)
Executes the nested region.

Parameters:
xmlFile - the xml file.
commands - the commands.

getMergeFieldNames

public java.lang.String[] getMergeFieldNames()
Returns a collection of mergefield names found in the document.

Returns:

getMergeFieldNames

public java.lang.String[] getMergeFieldNames(java.lang.String groupName)
Gets the merge field names.

Parameters:
groupName - Name of the region.
Returns:

getMergeGroupNames

public java.lang.String[] getMergeGroupNames()
Gets the merge field names.

Returns:

executeGroup

public void executeGroup(MailMergeDataTable dataSource)
Performs mail merge operation.

Parameters:
dataSource - MailMergeDataTable