ASPOSE home

com.aspose.words
Interface IMailMergeDataSource


public interface IMailMergeDataSource

Implement this interface to allow mail merge from a custom data source, such as list of objects.
See Also:
MailMerge

Property Getters/Setters Summary
abstract java.lang.StringgetTableName()
           Returns the name of the data source that this data source represnets.
 
Method Summary
abstract booleangetValue(java.lang.String fieldName, java.lang.Object[] fieldValue)
           Returns value for the specified name or false if the value is not found.
abstract booleanmoveNext()
           Advances to the next record in the data source.
 

Property Getters/Setters Detail

getTableName

public abstract java.lang.String getTableName()
Returns the name of the data source that this data source represnets.

If you are implementing IMailMergeDataSource, return the name of the data source from this property.

Aspose.Words uses this name to match against the mail merge region name specified in the template document. The comparision between the data source name and the mail merge region name is not case sensitive.

Returns:
The name of the data source. Empty string if the data source has no name.

Method Detail

getValue

public abstract boolean getValue(java.lang.String fieldName, java.lang.Object[] fieldValue)
                              throws java.lang.Exception
Returns value for the specified name or false if the value is not found.

fieldValue emulates .Net out parameter.

Before calling the method one shold initialize fieldValue parameter. After method returns true one can get the value from fieldValue[0]. For example:
            Object[] fieldValue = {null};
            boolean isValueFound = mDataSource.getValue(fieldName, fieldValue);
            int value = isValueFound ? fieldValue[0] : 0;
            

So, method implementer in case if value is founded shold assign founded value to fieldValue[0] and return true.

Parameters:
fieldName - The name of the data field.
fieldValue - Returns the field value inside fieldValue[0].
Returns:
true if value fond.

moveNext

public abstract boolean moveNext()
                              throws java.lang.Exception
Advances to the next record in the data source.
Returns:
True if moved to next record successfully. False if reached end of the data source.

See Also:
          Wiki - the home page for the Aspose.Words Product Documentation that includes Programmer's Guide, Knowledge Base and other articles.
          Aspose.Words Support Forum - our preferred method of support.
          Aspose.Words Team - contact Aspose.Words Team.


ASPOSE home