Methods

Methods

addCalculatedItem(name, formula)

Add a calculated 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 item's formula

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 auto sort field index. -1 means PivotField itself,others means the position of the data fields.

getBaseFieldIndex()

Represents the base field for a custom calculation.

getBaseIndex()

Represents the PivotField index in the base PivotFields.

getBaseItemIndex()

Represents the item in the base field for a custom calculation. Valid only for data fields.

getBaseItemPosition()

Represents the item in the base field for a custom calculation. 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

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 contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat

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 base item count of this pivot field.

getItems()

Get all base items;

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.

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 the PivotItems is hidden

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

Indicates 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

Indicates whether the specific PivotItem is hidden detail.

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 the field can include new items in manual filter The default value is false.

isInsertPageBreaksBetweenItems()

indicates whether the field can insert page breaks between items insert page break 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 the field can repeat items labels 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 auto sort field index. -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.

setBaseIndex()

Represents the PivotField index in the base PivotFields.

setBaseItemIndex()

Represents the item in the base field for a custom calculation. Valid only for data fields.

setBaseItemPosition()

Represents the item in the base field for a custom calculation. 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

setCurrentPageItem()

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

setDataDisplayFormat()

Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat

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 the field can include new items in manual filter The default value is false.

setInsertBlankRow()

Indicates whether inserting blank line after each item.

setInsertPageBreaksBetweenItems()

indicates whether the field can insert page breaks between items insert page break 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 the field can repeat items labels 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.

ungroup()

Ungroup the pivot field.