PivotTableDefinition Class

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

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Office2010.Excel.PivotTableDefinition

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

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(PivotEdits), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(PivotChanges), FileFormatVersions.Office2010)> _
<OfficeAvailabilityAttribute(FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(ConditionalFormats), FileFormatVersions.Office2010)> _
Public Class PivotTableDefinition _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As PivotTableDefinition
[ChildElementInfoAttribute(typeof(PivotEdits), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(PivotChanges), FileFormatVersions.Office2010)]
[OfficeAvailabilityAttribute(FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(ConditionalFormats), FileFormatVersions.Office2010)]
public class PivotTableDefinition : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • PivotEdits <x14:pivotEdits>

  • PivotChanges <x14:pivotChanges>

  • ConditionalFormats <x14:conditionalFormats>

2.4.17 pivotTableDefinition

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

A CT_PivotTableDefinition element that specifies additional properties of the PivotTable ([ISO/IEC-29500-1] section 18.10) view. 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="pivotTableDefinition" type="CT_PivotTableDefinition"/>

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

2.6.32 CT_PivotTableDefinition

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

Referenced by: pivotTableDefinition

This element specifies additional properties of a PivotTable ([ISO/IEC-29500-1] section 18.10) view.

Child Elements:

pivotEdits : A CT_PivotEdits element that specifies a collection of PivotTable What-if Analysis edits.

pivotChanges : A CT_PivotChanges element that specifies a collection of PivotTable What-if Analysis changes.

conditionalFormats : A CT_ConditionalFormats element that specifies a collection of conditional formats applied to PivotTable ([ISO/IEC-29500-1] section 18.10) view.

Attributes:

fillDownLabelsDefault : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies the behavior of PivotTable ([ISO/IEC-29500-1] section 18.10) fields that are not a part of the PivotTable ([ISO/IEC-29500-1] section 18.10) view if they are later added to a PivotTable ([ISO/IEC-29500-1] section 18.10) view. MUST be a value from the following table:

Value

Meaning

FALSE

Specifies that PivotTable ([ISO/IEC-29500-1] section 18.10) fields added to the PivotTable ([ISO/IEC-29500-1] section 18.10) view behave as if the fillDownLabels attribute of the CT_PivotField elements associated with those PivotTable ([ISO/IEC-29500-1] section 18.10) fields are set to FALSE.

TRUE

Specifies that PivotTable ([ISO/IEC-29500-1] section 18.10) fields added to the PivotTable ([ISO/IEC-29500-1] section 18.10) view behave as if the fillDownLabels attribute of the CT_PivotField elements associated with those PivotTable ([ISO/IEC-29500-1] section 18.10) fields are set to TRUE.

visualTotalsForSets : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether hidden PivotTable ([ISO/IEC-29500-1] section 18.10) items will be included when calculating totals for PivotTable ([ISO/IEC-29500-1] section 18.10) named sets. MUST be a value from the following table:

Value

Meaning

FALSE

Include hidden PivotTable ([ISO/IEC-29500-1] section 18.10) items in the set totals.

TRUE

Do not include hidden PivotTable ([ISO/IEC-29500-1] section 18.10) items in the set totals.

calculatedMembersInFilters : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether PivotTable ([ISO/IEC-29500-1] section 18.10) OLAP calculated members participate in PivotTable ([ISO/IEC-29500-1] section 18.10) manual filters and PivotTable ([ISO/IEC-29500-1] section 18.10) advanced filters.

Value

Meaning

FALSE

PivotTable ([ISO/IEC-29500-1] section 18.10) OLAP calculated members do not participate in PivotTable ([ISO/IEC-29500-1] section 18.10) manual filters and PivotTable ([ISO/IEC-29500-1] section 18.10) advanced filters.

TRUE

PivotTable ([ISO/IEC-29500-1] section 18.10) OLAP calculated members participate in PivotTable ([ISO/IEC-29500-1] section 18.10) manual filters and PivotTable ([ISO/IEC-29500-1] section 18.10) advanced filters as do other PivotTable ([ISO/IEC-29500-1] section 18.10) items.

altText : An ST_Xstring ([ISO/IEC-29500-1] section 22.9.2.19) attribute that specifies the alternate text for the PivotTable ([ISO/IEC-29500-1] section 18.10) view. The string MUST be less than or equal to 2000 characters in length.

altTextSummary : An ST_Xstring ([ISO/IEC-29500-1] section 22.9.2.19) attribute that specifies the alternate text summary for the PivotTable ([ISO/IEC-29500-1] section 18.10) view. This string MUST be less than or equal to 2000 characters in length.

enableEdit : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether PivotTable what-if analysis is enabled for the current PivotTable ([ISO/IEC-29500-1] section 18.10) view.

autoApply : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether PivotTable what-if analysis values are automatically allocated.

allocationMethod : An ST_AllocationMethod attribute that specifies the allocation method to use for PivotTable what-if analysis.

weightExpression : An ST_Xstring ([ISO/IEC-29500-1] section 22.9.2.19) attribute that specifies the multidimensional expression (MDX) of the weight expression for weighted allocations of PivotTable what-if analysis values. This string MUST be less than or equal to 65535 characters in length.

hideValuesRow : A boolean ([XMLSCHEMA2] section 3.2.2) attribute that specifies whether the values row in the PivotTable ([ISO/IEC-29500-1] section 18.10) report is visible.

Value

Meaning

FALSE

The values row in the PivotTable ([ISO/IEC-29500-1] section 18.10) report is visible.

TRUE

The values row in the PivotTable ([ISO/IEC-29500-1] section 18.10) report is not visible.

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

<xsd:complexType name="CT_PivotTableDefinition">

<xsd:sequence>

<xsd:element name="pivotEdits" type="CT_PivotEdits" minOccurs="0" maxOccurs="1"/>

<xsd:element name="pivotChanges" type="CT_PivotChanges" minOccurs="0" maxOccurs="1"/>

<xsd:element name="conditionalFormats" type="CT_ConditionalFormats" minOccurs="0"/>

</xsd:sequence>

<xsd:attribute name="fillDownLabelsDefault" type="xsd:boolean" use="optional" default="false"/>

<xsd:attribute name="visualTotalsForSets" type="xsd:boolean" use="optional" default="false"/>

<xsd:attribute name="calculatedMembersInFilters" type="xsd:boolean" use="optional" default="false"/>

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

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

<xsd:attribute name="enableEdit" type="xsd:boolean" use="optional" default="false"/>

<xsd:attribute name="autoApply" type="xsd:boolean" use="optional" default="false"/>

<xsd:attribute name="allocationMethod" type="ST_AllocationMethod" use="optional" default="equalAllocation"/>

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

<xsd:attribute name="hideValuesRow" type="xsd:boolean" use="optional" default="false"/>

</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

PivotTableDefinition Members

DocumentFormat.OpenXml.Office2010.Excel Namespace