asposecells.api

Class PivotField

Represents a field in a PivotTable report.

Property Getters/Setters Summary
methodgetAutoShowCount()
method
           Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.
methodgetAutoShowField()
method
           Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.
methodgetAutoSortField()
method
           Represents auto sort field index. -1 means PivotField itself,others means the position of the data fields.
methodgetBaseFieldIndex()
method
           Represents the base field for a custom calculation.
methodgetBaseIndex()
method
           Represents the PivotField index in the base PivotFields.
methodgetBaseItemIndex()
method
           Represents the item in the base field for a custom calculation. Valid only for data fields.
methodgetBaseItemPosition()
method
           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.
methodgetCurrentPageItem()
method
           Represents the current page item showing for the page field (valid only for page fields).
methodgetDataDisplayFormat()
method
           Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.
methodgetDisplayName()
method
           Represents the PivotField display name.
methodgetDragToColumn()
method
           Indicates whether the specified field can be dragged to the column position. The default value is true.
methodgetDragToData()
method
           Indicates whether the specified field can be dragged to the data position. The default value is true.
methodgetDragToHide()
method
           Indicates whether the specified field can be dragged to the hide position. The default value is true.
methodgetDragToPage()
method
           Indicates whether the specified field can be dragged to the page position. The default value is true.
methodgetDragToRow()
method
           Indicates whether the specified field can be dragged to the row position. The default value is true.
methodgetFunction()
method
           Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.
methodgetGroupSettings()
Gets the group settings of the pivot field.
methodgetInsertBlankRow()
method
           Indicates whether inserting blank line after each item.
methodisAscendShow()
method
           Indicates whether the specified PivotTable field is autoshown ascending.
methodisAscendSort()
method
           Indicates whether the specified PivotTable field is autosorted ascending.
methodisAutoShow()
method
           Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.
methodisAutoSort()
method
           Indicates whether the specified PivotTable field is automatically sorted.
methodisAutoSubtotals()
method
           Indicates whether the specified field shows automatic subtotals. Default is true.
methodisCalculatedField()
Indicates whether the specified PivotTable field is calculated field.
methodisIncludeNewItemsInFilter()
method
           indicates whether the field can include new items in manual filter The default value is false.
methodisInsertPageBreaksBetweenItems()
method
           indicates whether the field can insert page breaks between items insert page break after each item The default value is false.
methodisMultipleItemSelectionAllowed()
method
           indicates whether the field can have multiple items selected in the page field The default value is false.
methodisRepeatItemLabels()
method
           indicates whether the field can repeat items labels The default value is false.
methodgetItemCount()
Gets the base item count of this pivot field.
methodgetItems()
Get all base items;
methodgetName()
method
setName(value)
           Represents the name of PivotField.
methodgetNonAutoSortDefault()
method
           Indicates whether a sort operation that will be applied to this pivot field is an autosort operation or a simple data sort.
methodgetNumber()
method
setNumber(value)
           Represents the built-in display format of numbers and dates.
methodgetNumberFormat()
method
           Represents the custom display format of numbers and dates.
methodgetOriginalItems()
Get the original base items;
methodgetPivotItems()
Gets the pivot items of the pivot field
methodgetPosition()
Represents the index of PivotField in the region.
methodgetRange()
Gets the group range of the pivot field
methodgetShowAllItems()
method
           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.
methodgetShowCompact()
method
           Indicates whether display labels from the next field in the same column on the Pivot Table view
methodgetShowInOutlineForm()
method
           Indicates whether layout this field in outline form on the Pivot Table view
methodgetShowSubtotalAtTop()
method
           when ShowInOutlineForm is true, then display subtotals at the top of the list of items instead of at the bottom
 
Method Summary
methodaddCalculatedItem(name, formula)
Add a calculated item to the pivot field.
methodgetCalculatedFieldFormula()
Get the formula string of the specified calculated field .
methodgetFilters()
Gets all pivot filters of this pivot field.
methodgetPivotFilterByType(type)
Gets the pivot filter of the pivot field by type
methodgetPivotFilters()
Gets the pivot filters of the pivot field
methodgetSubtotals(subtotalType)
Indicates whether showing specified subtotal.
methodgroupBy(customGroupItems, newField)
Custom group the field.
methodgroupBy(start, end, groups, interval, firstAsNewField)
Group the file by the date group types.
methodgroupBy(interval, newField)
Automatically group the field with internal
methodgroupBy(start, end, interval, newField)
Group the file by number.
methodhideDetail(isHiddenDetail)
Sets whether the PivotItems in a pivot field is hidden detail.That is collapse/expand this field.
methodhideItem(index, isHidden)
Sets whether the specific PivotItem in a data field is hidden.
methodhideItem(itemValue, isHidden)
Sets whether the specific PivotItem in a data field is hidden.
methodhideItemDetail(index, isHiddenDetail)
Sets whether the specific PivotItem in a pivot field is hidden detail.
methodinitPivotItems()
Init the pivot items of the pivot field
methodisHiddenItem(index)
Indicates whether the specific PivotItem is hidden.
methodisHiddenItemDetail(index)
Indicates whether the specific PivotItem is hidden detail.
methodsetSubtotals(subtotalType, shown)
Sets whether the specified field shows that subtotals.
methodungroup()
Ungroup the pivot field.
 

    • Property Getters/Setters Detail

      • getRange : SxRng 

        SxRng 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.
      • isCalculatedField : boolean 

        boolean isCalculatedField()
        
        Indicates whether the specified PivotTable field is calculated field.
      • getBaseIndex/setBaseIndex : int 

        int getBaseIndex() / setBaseIndex(value)
        
        Represents the PivotField index in the base PivotFields.
      • getPosition : int 

        int getPosition()
        
        Represents the index of PivotField in the region.
      • getName/setName : String 

        String getName() / setName(value)
        
        Represents the name of PivotField.
      • getDisplayName/setDisplayName : String 

        String getDisplayName() / setDisplayName(value)
        
        Represents the PivotField display name.
      • isAutoSubtotals/setAutoSubtotals : boolean 

        boolean isAutoSubtotals() / setAutoSubtotals(value)
        
        Indicates whether the specified field shows automatic subtotals. Default is true.
      • getDragToColumn/setDragToColumn : boolean 

        boolean getDragToColumn() / setDragToColumn(value)
        
        Indicates whether the specified field can be dragged to the column position. The default value is true.
      • getDragToHide/setDragToHide : boolean 

        boolean getDragToHide() / setDragToHide(value)
        
        Indicates whether the specified field can be dragged to the hide position. The default value is true.
      • getDragToRow/setDragToRow : boolean 

        boolean getDragToRow() / setDragToRow(value)
        
        Indicates whether the specified field can be dragged to the row position. The default value is true.
      • getDragToPage/setDragToPage : boolean 

        boolean getDragToPage() / setDragToPage(value)
        
        Indicates whether the specified field can be dragged to the page position. The default value is true.
      • getDragToData/setDragToData : boolean 

        boolean getDragToData() / setDragToData(value)
        
        Indicates whether the specified field can be dragged to the data position. The default value is true.
      • isMultipleItemSelectionAllowed/setMultipleItemSelectionAllowed : boolean 

        boolean isMultipleItemSelectionAllowed() / setMultipleItemSelectionAllowed(value)
        
        indicates whether the field can have multiple items selected in the page field The default value is false.
      • isRepeatItemLabels/setRepeatItemLabels : boolean 

        boolean isRepeatItemLabels() / setRepeatItemLabels(value)
        
        indicates whether the field can repeat items labels The default value is false.
      • isIncludeNewItemsInFilter/setIncludeNewItemsInFilter : boolean 

        boolean isIncludeNewItemsInFilter() / setIncludeNewItemsInFilter(value)
        
        indicates whether the field can include new items in manual filter The default value is false.
      • isInsertPageBreaksBetweenItems/setInsertPageBreaksBetweenItems : boolean 

        boolean isInsertPageBreaksBetweenItems() / setInsertPageBreaksBetweenItems(value)
        
        indicates whether the field can insert page breaks between items insert page break after each item The default value is false.
      • getShowAllItems/setShowAllItems : boolean 

        boolean getShowAllItems() / setShowAllItems(value)
        
        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.
      • getNonAutoSortDefault/setNonAutoSortDefault : boolean 

        boolean getNonAutoSortDefault() / setNonAutoSortDefault(value)
        
        Indicates whether a sort operation that will be applied to this pivot field is an autosort operation or a simple data sort.
      • isAutoSort/setAutoSort : boolean 

        boolean isAutoSort() / setAutoSort(value)
        
        Indicates whether the specified PivotTable field is automatically sorted.
      • isAscendSort/setAscendSort : boolean 

        boolean isAscendSort() / setAscendSort(value)
        
        Indicates whether the specified PivotTable field is autosorted ascending.
      • getAutoSortField/setAutoSortField : int 

        int getAutoSortField() / setAutoSortField(value)
        
        Represents auto sort field index. -1 means PivotField itself,others means the position of the data fields.
      • isAutoShow/setAutoShow : boolean 

        boolean isAutoShow() / setAutoShow(value)
        
        Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.
      • isAscendShow/setAscendShow : boolean 

        boolean isAscendShow() / setAscendShow(value)
        
        Indicates whether the specified PivotTable field is autoshown ascending.
      • getAutoShowCount/setAutoShowCount : int 

        int getAutoShowCount() / setAutoShowCount(value)
        
        Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.
      • getAutoShowField/setAutoShowField : int 

        int getAutoShowField() / setAutoShowField(value)
        
        Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.
      • getFunction/setFunction : int 

        int getFunction() / setFunction(value)
        
        Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.
      • getDataDisplayFormat/setDataDisplayFormat : int 

        int getDataDisplayFormat() / setDataDisplayFormat(value)
        
        Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat
      • getBaseFieldIndex/setBaseFieldIndex : int 

        int getBaseFieldIndex() / setBaseFieldIndex(value)
        
        Represents the base field for a custom calculation.
      • getBaseItemPosition/setBaseItemPosition : int 

        int getBaseItemPosition() / setBaseItemPosition(value)
        
        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
      • getBaseItemIndex/setBaseItemIndex : int 

        int getBaseItemIndex() / setBaseItemIndex(value)
        
        Represents the item in the base field for a custom calculation. Valid only for data fields.
      • getCurrentPageItem/setCurrentPageItem : int 

        int getCurrentPageItem() / setCurrentPageItem(value)
        
        Represents the current page item showing for the page field (valid only for page fields).
      • getNumber/setNumber : int 

        int getNumber() / setNumber(value)
        
        Represents the built-in display format of numbers and dates.
      • getInsertBlankRow/setInsertBlankRow : boolean 

        boolean getInsertBlankRow() / setInsertBlankRow(value)
        
        Indicates whether inserting blank line after each item.
      • getShowSubtotalAtTop/setShowSubtotalAtTop : boolean 

        boolean getShowSubtotalAtTop() / setShowSubtotalAtTop(value)
        
        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.
      • getShowInOutlineForm/setShowInOutlineForm : boolean 

        boolean getShowInOutlineForm() / setShowInOutlineForm(value)
        
        Indicates whether layout this field in outline form on the Pivot Table view
      • getNumberFormat/setNumberFormat : String 

        String getNumberFormat() / setNumberFormat(value)
        
        Represents the custom display format of numbers and dates.
      • getItems : String[] 

        String[] getItems()
        
        Get all base items;
      • getOriginalItems : String[] 

        String[] getOriginalItems()
        
        Get the original base items;
      • getItemCount : int 

        int getItemCount()
        
        Gets the base item count of this pivot field.
      • getShowCompact/setShowCompact : boolean 

        boolean getShowCompact() / setShowCompact(value)
        
        Indicates whether display labels from the next field in the same column on the Pivot Table view
    • Method Detail

      • getPivotFilterByType

        PivotFilter getPivotFilterByType(type)
        Gets the pivot filter of the pivot field by type
        Parameters:
        type - A PivotFilterType value.
      • getPivotFilters

        ArrayList 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.
      • getFilters

        PivotFilter[] getFilters()
        Gets all pivot filters of this pivot field.
      • initPivotItems

         initPivotItems()
        Init the pivot items of the pivot field
      • groupBy

         groupBy(interval, newField)
        Automatically group the field with internal
        Parameters:
        interval: float - 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

         groupBy(start, end, groups, interval, firstAsNewField)
        Group the file by the date group types.
        Parameters:
        start: DateTime - The start datetime
        end: DateTime - The end of datetime
        groups: Number Array - Group types
        interval: float - The interval
        firstAsNewField: boolean - Indicates whether adding a new field to the pivottable. Only for the first group item.
      • groupBy

         groupBy(start, end, interval, newField)
        Group the file by number.
        Parameters:
        start: float - The start value
        end: float - The end of value
        interval: float - The interval
        newField: boolean - Indicates whether adding a new field to the pivottable
      • groupBy

         groupBy(customGroupItems, newField)
        Custom group the field.
        Parameters:
        customGroupItems: CustomPiovtFieldGroupItem[] - The custom group items.
        newField: boolean - Indicates whether adding a new field to the pivottable
      • ungroup

         ungroup()
        Ungroup the pivot field.
      • getCalculatedFieldFormula

        String getCalculatedFieldFormula()
        Get the formula string of the specified calculated field .
      • setSubtotals

         setSubtotals(subtotalType, shown)
        Sets whether the specified field shows that subtotals. PivotFieldSubtotalType
        Parameters:
        subtotalType: int - A PivotFieldSubtotalType value. subtotals type.
        shown: boolean - whether the specified field shows that subtotals.
      • getSubtotals

        boolean getSubtotals(subtotalType)
        Indicates whether showing specified subtotal.
        Parameters:
        subtotalType: int - A PivotFieldSubtotalType value. subtotal type.
        Returns:
        Returns whether showing specified subtotal.
      • isHiddenItem

        boolean isHiddenItem(index)
        Indicates whether the specific PivotItem is hidden.
        Parameters:
        index: int - the index of the pivotItem in the pivotField.
        Returns:
        whether the specific PivotItem is hidden
      • hideItem

         hideItem(index, isHidden)
        Sets whether the specific PivotItem in a data field is hidden.
        Parameters:
        index: int - the index of the pivotItem in the pivotField.
        isHidden: boolean - whether the specific PivotItem is hidden
      • isHiddenItemDetail

        boolean isHiddenItemDetail(index)
        Indicates whether the specific PivotItem is hidden detail.
        Parameters:
        index: int - the index of the pivotItem in the pivotField.
        Returns:
        whether the specific PivotItem is hidden detail
      • hideItemDetail

         hideItemDetail(index, isHiddenDetail)
        Sets whether the specific PivotItem in a pivot field is hidden detail.
        Parameters:
        index: int - the index of the pivotItem in the pivotField.
        isHiddenDetail: boolean - whether the specific PivotItem is hidden
      • hideDetail

         hideDetail(isHiddenDetail)
        Sets whether the PivotItems in a pivot field is hidden detail.That is collapse/expand this field.
        Parameters:
        isHiddenDetail: boolean - whether the PivotItems is hidden
      • hideItem

         hideItem(itemValue, isHidden)
        Sets whether the specific PivotItem in a data field is hidden.
        Parameters:
        itemValue: String - the value of the pivotItem in the pivotField.
        isHidden: boolean - whether the specific PivotItem is hidden
      • addCalculatedItem

         addCalculatedItem(name, formula)
        Add a calculated item to the pivot field. Only supports to add calculated item to Row/Column field.
        Parameters:
        name: String - The item's name.
        formula: String - The item's formula