ColumnIndex Class

Index of Column Containing Unique Values for Record.When the object is serialized out as xml, its qualified name is w:column.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.UnsignedDecimalNumberType
        DocumentFormat.OpenXml.Wordprocessing.ColumnIndex

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class ColumnIndex _
    Inherits UnsignedDecimalNumberType
'Usage
Dim instance As ColumnIndex
public class ColumnIndex : UnsignedDecimalNumberType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.14.6 column (Index of Column Being Mapped)

This element specifies the zero-based index of the column within a given external data source which shall be mapped to the local name of a specific MERGEFIELD field (§17.16.5.35) specified by the parent field mapping data. The val attribute specifies this index value, which is used to look up the appropriate column in the data source.

If this element is omitted, or its value exceeds the number of columns in the associated data source, then the index of the referenced column shall be assumed to be 0.

[Example: Consider a source document that is connected to an external data source with three columns. Within this external data source, these are three columns are ordered and titled as follows: first, middle, and last, respectively. The following WordprocessingML specifies that when this document was connected to the data source, these columns were ordered in this manner:

<w:fieldMapData>
…
<w:name w:val="first" />
<w:column w:val="0" />
</w:fieldMapData>
<w:fieldMapData>
…
<w:name w:val="middle" />
<w:column w:val="1" />
</w:fieldMapData>
<w:fieldMapData>
…
<w:name w:val="last" />
<w:column w:val="2" />
</w:fieldMapData>

The WordprocessingML above demonstrates that the column titled first must be associated with the first column in the external database by specifying a column element with its val attribute equal to 0. In addition, the column titled middle must be associated with the second column in the external database by specifying a column element with its val attribute equal to 1. Finally, the column titled last must be associated with the third column in the external database by specifying a column element with its val attribute equal to 2. end example]

It is important to realize that the name element's values are a cache of the last time the document was connected to the database, and the indices specified must be used to connect the field mappings with the columns in the data source. end example]

Parent Elements

fieldMapData (§17.14.15)

Attributes

Description

val (Decimal Number Value)

Specifies that the contents of this attribute contains a decimal number.

The contents of this decimal number are interpreted based on the context of the parent XML element.

[Example: Consider the following numeric WordprocessingML property of simple type ST_DecimalNumber:

<… w:val="1512645511" />

The value of the val attribute is a decimal number whose value must be interpreted in the context of the parent element. end example]

The possible values for this attribute are defined by the ST_DecimalNumber simple type (§17.18.10).

[Note: The W3C XML Schema definition of this element’s content model (CT_DecimalNumber) is located in §A.1. end note]

[ISO/IEC 29500-1 1st Edition]

17.14.7 column (Index of Column Containing Unique Values for Record)

This element specifies the column within the specified external data source that contains unique data for the current record within that data source. This element shall be used in conjunction with the uniqueTag element (§17.14.35) to maintain a relationship between a specific record within an external data source and a given source or merged document. The val attribute on this element shall be interpreted as a zero-based index into the columns specified by the data source, specifying the resulting column as the column in which the uniqueTag element shall be looked up.

If this element specifies a column number which exceeds the number of columns in the specified external data source, then its value shall be ignored.

[Note: This information is necessary as part of a mail merge as records can be added or deleted from external data sources, and a means must be provided to maintain record-specific inclusion or exclusion data using the active element (§17.14.1) and the affected external data record when the WordprocessingML document is reconnected to the external data source irrespective of the ordering of the records within the external data source. end note]

[Example: Consider the following WordprocessingML fragment for the information about a single record in a source document for a mail merge:

<w:recipientData>
  <w:active w:val="0" />
  <w:column w:val="12" /> 
  <w:uniqueTag>258865469</w:uniqueTag> 
</w:recipientData>

The external data record associated with this information is specified via the column in the external data source corresponding to the column element with a val attribute equal to 12, which contains a row whose value in this column has a value corresponding to the uniqueTag element (§17.14.35) with a val attribute equal to 258865469. This record is not imported into the merged WordprocessingML document as the active (§17.14.1) element associated with the given external data record has a val attribute equal to 0.

In other words, when the specified external data source is connected to, the record within the thirteenth column of the external data source that has the contents 258865469, and not populate mapped fields in a merged document with data from that record. end example]

Parent Elements

recipientData (§17.14.27)

Attributes

Description

val (Decimal Number Value)

Specifies that the contents of this attribute contains a decimal number.

The contents of this decimal number are interpreted based on the context of the parent XML element.

[Example: Consider the following numeric WordprocessingML property of simple type ST_DecimalNumber:

<… w:val="1512645511" />

The value of the val attribute is a decimal number whose value must be interpreted in the context of the parent element. end example]

The possible values for this attribute are defined by the ST_DecimalNumber simple type (§17.18.10).

[Note: The W3C XML Schema definition of this element’s content model (CT_DecimalNumber) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ColumnIndex Members

DocumentFormat.OpenXml.Wordprocessing Namespace