Partager via


DataField Class

Defines the DataField Class.This class is only available in Office2010.When the object is serialized out as xml, its qualified name is x14:dataField.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Office2010.Excel.DataField

Namespace:  DocumentFormat.OpenXml.Office2010.Excel
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
Public Class DataField _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As DataField
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
public class DataField : OpenXmlLeafElement

Remarks

2.4.15 dataField

Target namespace: https://schemas.microsoft.com/office/spreadsheetml/2010/main

A CT_DataField element that specifies extended information about a PivotTable ([ISO/IEC-29500-1] section 18.10) data field item. See Pivot Table under Extensions by Part for how this element integrates with [ISO/IEC-29500-1].

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this element.

<xsd:element name="dataField" type="CT_DataField"/>

See section 5.3 for the full W3C XML Schema ([XMLSCHEMA1] section 2.1).

2.6.25 CT_DataField

Target namespace: https://schemas.microsoft.com/office/spreadsheetml/2010/main

Referenced by: dataField

This complex type specifies extended information about a PivotTable ([ISO/IEC-29500-1] section 18.10) data field item ([ISO/IEC-29500-1] section 18.10.1.22).

Attributes:

pivotShowAs : An ST_PivotShowAs attribute that specifies the data display format for this PivotTable ([ISO/IEC-29500-1] section 18.10) data field item. If this attribute is specified, the showDataAs attribute of the ancestor CT_Datafield ([ISO/IEC-29500-4] section A.2) element MUST NOT be specified. If this attribute is equal to “percentOfParent”, “percentOfRunningTotal”, “rankAscending”, or “rankDescending”, the baseField attribute of the ancestor CT_Datafield ([ISO/IEC-29500-4] section A.2) element MUST be greater than or equal to 0.

sourceField : An unsignedInt ([XMLSCHEMA2] section 3.3.22) attribute that specifies the zero-based index of the CT_PivotField ([ISO/IEC-29500-4] section A.2) element in the list of CT_PivotField ([ISO/IEC-29500-4] section A.2) elements specified by the CT_PivotFields ([ISO/IEC-29500-4] section A.2) element that this data item summarizes.

If an OLAP measure is summarized in a PivotTable ([ISO/IEC-29500-1] section 18.10) as a data field item ([ISO/IEC-29500-1] section 18.10.1.22) more than once, data field items ([ISO/IEC-29500-1] section 18.10.1.22) that specify that OLAP measure after the first data field item ([ISO/IEC-29500-1] section 18.10.1.22) that specifies that OLAP measure MUST have a descendant CT_DataField element with a sourceField specified.

If this attribute is specified, the CT_PivotField ([ISO/IEC-29500-4] section A.2) element specified by the fld attribute of the ancestor CT_Datafield ([ISO/IEC-29500-4] section A.2) element MUST have a descendant CT_PivotField element with an ignore attribute equal to TRUE.

If this attribute is specified, the CT_CacheField ([ISO/IEC-29500-4] section A.2) element with a zero-based index in the list of CT_CacheField ([ISO/IEC-29500-4] section A.2) elements specified by the CT_CacheFields ([ISO/IEC-29500-4] section A.2) element equal to the fld attribute of the ancestor CT_Datafield ([ISO/IEC-29500-4] section A.2) element that exists in the Pivot Table Cache Definition part ([ISO/IEC-29500-1] section 12.3.12) specified by the cacheId attribute of the CT_PivotTableDefintion ([ISO/IEC-29500-4] section A.2) element that is the ancestor of this element MUST have a descendant CT_CacheField element. The CT_CacheHierarchy ([ISO/IEC-29500-4] section A.2) element specified by the hierarchy attribute of that CT_CacheField ([ISO/IEC-29500-4] section A.2) element MUST have a descendent CT_CacheHierarchy element with an ignore attribute equal to TRUE. The CT_PivotHierarchy ([ISO/IEC-29500-4] section A.2) element with a zero-based index in the list of CT_PivotHierarchy ([ISO/IEC-29500-4] section A.2) elements specified by the CT_PivotHierarchies ([ISO/IEC-29500-4] section A.2) element in this part equal to the zero-based index of that CT_CacheHierarchy ([ISO/IEC-29500-4] section A.2) element in the list of CT_CacheHierarchy ([ISO/IEC-29500-4] section A.2) elements specified by the CT_CacheHierarchies ([ISO/IEC-29500-4] section A.2) element MUST have a descendant CT_PivotHierarchy element.

If this attribute is specified, the fld attribute of the ancestor CT_Datafield ([ISO/IEC-29500-4] section A.2) element SHOULD<24> be ignored.

This attribute MUST NOT be specified for non-OLAP PivotTables ([ISO/IEC-29500-1] section 18.10).

uniqueName : An ST_Xstring ([ISO/IEC-29500-1] section 22.9.2.19) attribute that specifies the unique name for duplicated OLAP measures. MUST be unique within this part. MUST be less than or equal to 65535 characters in length.

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this complex type.

<xsd:complexType name="CT_DataField">

<xsd:attribute name="pivotShowAs" type="ST_PivotShowAs" use="optional"/>

<xsd:attribute name="sourceField" type="xsd:unsignedInt" use="optional"/>

<xsd:attribute name="uniqueName" type="x:ST_Xstring" use="optional"/>

</xsd:complexType>

See section 5.3 for the full W3C XML Schema ([XMLSCHEMA1] section 2.1).

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

DataField Members

DocumentFormat.OpenXml.Office2010.Excel Namespace