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(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(java.lang.String xmlFile)
          Performs Mail Merge within a region from a DataTable.
 boolean getClearFields()
          Gets a value indicating whether [clear fields].
 boolean getClearGroupTag()
          Gets a value indicating whether [clear group tag].
protected  Document getDocument()
          Gets the document.
 boolean getHideEmptyGroup()
          Gets a value indicating whether to remove groups which contain empty merge fields.
 boolean getHideEmptyParagraphs()
          Gets a value indicating whether to remove paragraphs which contain empty merge fields.
 MailMergeMainDocumentType getMailMergeMainDocumentType()
           
 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 group names.
 void setClearFields(boolean value)
          Sets a value indicating whether [clear fields].
 void setClearGroupTag(boolean value)
          Sets a value indicating whether [clear group tag].
 void setHideEmptyGroup(boolean value)
          Sets a value indicating whether to remove groups which contain empty merge fields.
 void setHideEmptyParagraphs(boolean value)
          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 a value indicating whether [clear fields]. by default value is true.

Returns:
boolean.

setClearFields

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

Parameters:
value - if it clears the fields, set to true.

getMailMergeMainDocumentType

public MailMergeMainDocumentType getMailMergeMainDocumentType()

setMailMergeMainDocumentType

public void setMailMergeMainDocumentType(MailMergeMainDocumentType value)

getClearGroupTag

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

Returns:
boolean.

setClearGroupTag

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

Parameters:
value - if it clears group tag, set to true.

getDocument

protected Document getDocument()
Gets the document.

Returns:
the document.

getHideEmptyParagraphs

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

Returns:
boolean.

setHideEmptyParagraphs

public void setHideEmptyParagraphs(boolean value)
Sets a value indicating whether to remove paragraphs which contain empty merge fields.

Parameters:
value - The value.

getHideEmptyGroup

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

Returns:
boolean

setHideEmptyGroup

public void setHideEmptyGroup(boolean value)
Sets a value indicating whether to remove groups which contain empty merge fields.

Parameters:
value - the value.

execute

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

Parameters:
fieldNames - the field names.
fieldValues - the field values.
Throws:
java.lang.Exception - exception

execute

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

Parameters:
dataSource - the data source.
Throws:
java.lang.Exception

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

executeWidthNestedRegion

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

Parameters:
dataSource - the data source.
filters - the filters.
Throws:
java.lang.Exception

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:
The merge field names.

getMergeFieldNames

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

Parameters:
groupName - the group name.
Returns:
The merge field names.

getMergeGroupNames

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

Returns:
the the merge group names.

executeGroup

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

Parameters:
dataSource - The MailMergeDataTable.
Throws:
java.lang.Exception