Methods

Methods

addCalculatedItem(name, formula)

Add a calculated formula item to the pivot field. Only supports to add calculated item to Row/Column field.

Parameters

Name Type Optional Description

name

String

 

The item's name.

formula

String

 

The formula of pivot item.

getAutoShowCount()

Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.

getAutoShowField()

Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.

getAutoSortField()

Represents the index of field which is auto sorted. -1 means PivotField itself,others means the position of the data fields.

getBaseFieldIndex()

Represents the base field for a custom calculation when the ShowDataAs calculation is in use. NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseFieldIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getBaseIndex()

Represents the PivotField index in the base PivotFields.

getBaseItemIndex()

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields. NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseItemIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getBaseItemPosition()

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields. Because PivotItemPosition.Custom is only for read,if you need to set PivotItemPosition.Custom, please set PivotField.BaseItemIndex attribute. The value of the property is PivotItemPosition integer constant.PivotItemPosition NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseItemType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getCalculatedFieldFormula()

Get the formula string of the specified calculated field .

getCurrentPageItem()

Represents the current page item showing for the page field (valid only for page fields).

getDataDisplayFormat()

Represents how to display the values in a data field of the pivot report. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.CalculationType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

getDisplayName()

Represents the PivotField display name.

getDragToColumn()

Indicates whether the specified field can be dragged to the column position. The default value is true.

getDragToData()

Indicates whether the specified field can be dragged to the data position. The default value is true.

getDragToHide()

Indicates whether the specified field can be dragged to the hide position. The default value is true.

getDragToPage()

Indicates whether the specified field can be dragged to the page position. The default value is true.

getDragToRow()

Indicates whether the specified field can be dragged to the row position. The default value is true.

getFilters()

Gets all pivot filters of this pivot field.

getFunction()

Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.

getGroupSettings()

Gets the group settings of the pivot field. If this field is not grouped, Null will be returned.

getInsertBlankRow()

Indicates whether inserting blank line after each item.

getItemCount()

Gets the count of the base items in this pivot field.

getItems()

Get all labels of pivot items in this field.

getName()

Represents the name of PivotField.

getNonAutoSortDefault()

Indicates whether a sort operation that will be applied to this pivot field is an autosort operation or a simple data sort.

getNumber()

Represents the built-in display format of numbers and dates.

getNumberFormat()

Represents the custom display format of numbers and dates.

getOriginalItems()

Get the original base items;

getPivotFilterByType()

Gets the pivot filter of the pivot field by type

getPivotFilters()

Gets the pivot filters of the pivot field NOTE: This method is now obsolete. Instead, please use PivotField.GetFilters() method. This method will be removed 12 months later since November 2023. Aspose apologizes for any inconvenience you may have experienced.

getPivotItems()

Gets the pivot items of the pivot field

getPosition()

Represents the index of PivotField in the region.

getRange()

Gets the group range of the pivot field NOTE: This method is now obsolete. Instead, please use PivotField.GroupSettings property. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.

getShowAllItems()

Indicates whether all items displays in the PivotTable report, even if they don't contain summary data. show items with no data The default value is false.

getShowCompact()

Indicates whether display labels from the next field in the same column on the Pivot Table view

getShowInOutlineForm()

Indicates whether layout this field in outline form on the Pivot Table view

getShowSubtotalAtTop()

when ShowInOutlineForm is true, then display subtotals at the top of the list of items instead of at the bottom Only works when ShowInOutlineForm is true.

getShowValuesSetting()

Gets the settings of showing values as when the ShowDataAs calculation is in use.

getSubtotals(subtotalType) → boolean

Indicates whether showing specified subtotal.

Parameter

Name Type Optional Description

subtotalType

Number

 

PivotFieldSubtotalType

Returns

boolean Returns whether showing specified subtotal.

groupBy(interval, newField)

Automatically group the field with internal

Parameters

Name Type Optional Description

interval

Number

 

The internal of group. Automatic value will be assigned if it's zero,

newField

boolean

 

Indicates whether adding a new field to the pivottable.

groupBy(start, end, groups, interval, firstAsNewField)

Group the file by the date group types.

Parameters

Name Type Optional Description

start

DateTime

 

The start datetime

end

DateTime

 

The end of datetime

groups

Array of Number

 

Group types

interval

Number

 

The interval

firstAsNewField

boolean

 

Indicates whether adding a new field to the pivottable. Only for the first group item.

groupBy(start, end, interval, newField)

Group the file by number.

Parameters

Name Type Optional Description

start

Number

 

The start value

end

Number

 

The end of value

interval

Number

 

The interval

newField

boolean

 

Indicates whether adding a new field to the pivottable

groupBy(customGroupItems, newField)

Custom group the field.

Parameters

Name Type Optional Description

customGroupItems

Array of CustomPiovtFieldGroupItem

 

The custom group items.

newField

boolean

 

Indicates whether adding a new field to the pivottable

hideDetail(isHiddenDetail)

Sets whether the PivotItems in a pivot field is hidden detail.That is collapse/expand this field.

Parameter

Name Type Optional Description

isHiddenDetail

boolean

 

Whether hide the detail of the pivot field.

hideItem(index, isHidden)

Sets whether the specific PivotItem in a data field is hidden.

Parameters

Name Type Optional Description

index

Number

 

the index of the pivotItem in the pivotField.

isHidden

boolean

 

whether the specific PivotItem is hidden

hideItem(itemValue, isHidden)

Sets whether the specific PivotItem in a data field is hidden.

Parameters

Name Type Optional Description

itemValue

String

 

the value of the pivotItem in the pivotField.

isHidden

boolean

 

whether the specific PivotItem is hidden

hideItemDetail(index, isHiddenDetail)

Sets whether the specific PivotItem in a pivot field is hidden detail.

Parameters

Name Type Optional Description

index

Number

 

the index of the pivotItem in the pivotField.

isHiddenDetail

boolean

 

whether the specific PivotItem is hidden

initPivotItems()

Init the pivot items of the pivot field

isAscendShow()

Indicates whether the specified PivotTable field is autoshown ascending.

isAscendSort()

Indicates whether the specified PivotTable field is autosorted ascending.

isAutoShow()

Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.

isAutoSort()

Indicates whether the specified PivotTable field is automatically sorted.

isAutoSubtotals()

Indicates whether the specified field shows automatic subtotals. Default is true.

isCalculatedField()

Indicates whether the specified PivotTable field is calculated field.

isHiddenItem(index) → boolean

Gets whether the specific PivotItem is hidden.

Parameter

Name Type Optional Description

index

Number

 

The index of the pivotItem in the pivotField.

Returns

boolean whether the specific PivotItem is hidden

isHiddenItemDetail(index) → boolean

Gets whether hidding the detail of the specific PivotItem..

Parameter

Name Type Optional Description

index

Number

 

The index of the pivotItem in the pivotField.

Returns

boolean whether the specific PivotItem is hidden detail

isIncludeNewItemsInFilter()

Indicates whether including new items to the field in manual filter. The default value is false.

isInsertPageBreaksBetweenItems()

Indicates whether inserting page breaks after each item. The default value is false.

isMultipleItemSelectionAllowed()

indicates whether the field can have multiple items selected in the page field The default value is false.

isRepeatItemLabels()

Indicates whether repeating labels of the field in the region. The default value is false.

setAscendShow()

Indicates whether the specified PivotTable field is autoshown ascending.

setAscendSort()

Indicates whether the specified PivotTable field is autosorted ascending.

setAutoShow()

Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.

setAutoShowCount()

Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.

setAutoShowField()

Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.

setAutoSort()

Indicates whether the specified PivotTable field is automatically sorted.

setAutoSortField()

Represents the index of field which is auto sorted. -1 means PivotField itself,others means the position of the data fields.

setAutoSubtotals()

Indicates whether the specified field shows automatic subtotals. Default is true.

setBaseFieldIndex()

Represents the base field for a custom calculation when the ShowDataAs calculation is in use. NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseFieldIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setBaseIndex()

Represents the PivotField index in the base PivotFields.

setBaseItemIndex()

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields. NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseItemIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setBaseItemPosition()

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields. Because PivotItemPosition.Custom is only for read,if you need to set PivotItemPosition.Custom, please set PivotField.BaseItemIndex attribute. The value of the property is PivotItemPosition integer constant.PivotItemPosition NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.BaseItemType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setCurrentPageItem()

Represents the current page item showing for the page field (valid only for page fields).

setDataDisplayFormat()

Represents how to display the values in a data field of the pivot report. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat NOTE: This property is now obsolete. Instead, please use PivotField.PivotShowValuesSetting.CalculationType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

setDisplayName()

Represents the PivotField display name.

setDragToColumn()

Indicates whether the specified field can be dragged to the column position. The default value is true.

setDragToData()

Indicates whether the specified field can be dragged to the data position. The default value is true.

setDragToHide()

Indicates whether the specified field can be dragged to the hide position. The default value is true.

setDragToPage()

Indicates whether the specified field can be dragged to the page position. The default value is true.

setDragToRow()

Indicates whether the specified field can be dragged to the row position. The default value is true.

setFunction()

Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.

setIncludeNewItemsInFilter()

Indicates whether including new items to the field in manual filter. The default value is false.

setInsertBlankRow()

Indicates whether inserting blank line after each item.

setInsertPageBreaksBetweenItems()

Indicates whether inserting page breaks after each item. The default value is false.

setMultipleItemSelectionAllowed()

indicates whether the field can have multiple items selected in the page field The default value is false.

setName()

Represents the name of PivotField.

setNonAutoSortDefault()

Indicates whether a sort operation that will be applied to this pivot field is an autosort operation or a simple data sort.

setNumber()

Represents the built-in display format of numbers and dates.

setNumberFormat()

Represents the custom display format of numbers and dates.

setRepeatItemLabels()

Indicates whether repeating labels of the field in the region. The default value is false.

setShowAllItems()

Indicates whether all items displays in the PivotTable report, even if they don't contain summary data. show items with no data The default value is false.

setShowCompact()

Indicates whether display labels from the next field in the same column on the Pivot Table view

setShowInOutlineForm()

Indicates whether layout this field in outline form on the Pivot Table view

setShowSubtotalAtTop()

when ShowInOutlineForm is true, then display subtotals at the top of the list of items instead of at the bottom Only works when ShowInOutlineForm is true.

setSubtotals(subtotalType, shown)

Sets whether the specified field shows that subtotals. PivotFieldSubtotalType

Parameters

Name Type Optional Description

subtotalType

Number

 

PivotFieldSubtotalType

shown

boolean

 

whether the specified field shows that subtotals.

showValuesAs(displayFormat, baseField, baseItemPositionType, baseItem)

Show value of data field as different display format when the ShowDataAs calculation is in use. Only for data field.

Parameters

Name Type Optional Description

displayFormat

Number

 

PivotFieldDataDisplayFormat

baseField

Number

 

The index to the field which ShowDataAs calculation bases on.

baseItemPositionType

Number

 

PivotItemPositionType

baseItem

Number

 

The index to the base item which ShowDataAs calculation bases on. Only works when baseItemPositionType is custom.

ungroup()

Ungroup the pivot field.