com.aspose.words

Class OdsoFieldMappingType

  • java.lang.Object
    • com.aspose.words.OdsoFieldMappingType
public class OdsoFieldMappingType 
extends java.lang.Object

Utility class containing constants. Specifies the possible types used to indicate if a given mail merge field has been mapped to a column in the given external data source.

Example:

Shows how to access the collection of data that maps data source columns to merge fields.
Document doc = new Document(getMyDir() + "OdsoData.doc");

// This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD,
// ADDRESSBLOCK and GREETINGLINE fields during a mail merge
OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas();

Assert.assertEquals(fieldMapDataCollection.getCount(), 30);
int index = 0;

for (OdsoFieldMapData data : fieldMapDataCollection) {
    System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType()));

    if (data.getType() != OdsoFieldMappingType.NULL) {
        System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName()));
    } else {
        System.out.println("\tNo valid column to field mapping data present.");
    }

    Assert.assertNotEquals(data, data.deepClone());
}
See Also:
OdsoFieldMapData.Type

Field Summary
static final intCOLUMN = 0
Specifies that the mail merge field has been mapped to a column in the given external data source.
static final intNULL = 1
Specifies that the mail merge field has not been mapped to a column in the given external data source.
static final intDEFAULT = 1
Equals to NULL.
 

    • Field Detail

      • COLUMN = 0

        public static final int COLUMN
        Specifies that the mail merge field has been mapped to a column in the given external data source.
      • NULL = 1

        public static final int NULL
        Specifies that the mail merge field has not been mapped to a column in the given external data source.
      • DEFAULT = 1

        public static final int DEFAULT
        Equals to NULL.