com.aspose.cells

Class PivotField

  • java.lang.Object
    • com.aspose.cells.PivotField
public class PivotField 
extends java.lang.Object

Represents a field in a PivotTable report.

Property Getters/Setters Summary
intgetAutoShowCount()
void
           Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.
intgetAutoShowField()
void
           Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.
intgetAutoSortField()
void
           Represents auto sort field index. -1 means PivotField itself,others means the position of the data fields.
intgetBaseField()
void
setBaseField(intvalue)
           Represents the base field for a custom calculation. Please use PivotField.BaseFieldIndex instead
intgetBaseFieldIndex()
void
           Represents the base field for a custom calculation.
intgetBaseIndex()
void
setBaseIndex(intvalue)
           Represents the PivotField index in the base PivotFields.
intgetBaseItem()
void
setBaseItem(intvalue)
           Represents the item in the base field for a custom calculation. Valid only for data fields.
intgetBaseItemIndex()
void
           Represents the item in the base field for a custom calculation. Valid only for data fields.
intgetBaseItemPosition()
void
           Represents the item in the base field for a custom calculation. Valid only for data fields. Because PivotItemPosition.InnerCustom is only for read,if you need to set PivotItemPosition.InnerCustom, please set PivotField.BaseItemIndex attribute. The value of the property is PivotItemPosition integer constant.
shortgetCurrentPageItem()
void
setCurrentPageItem(shortvalue)
           Represents the current page item showing for the page field (valid only for page fields).
intgetDataDisplayFormat()
void
           Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.
java.lang.StringgetDisplayName()
void
setDisplayName(java.lang.Stringvalue)
           Represents the PivotField display name.
booleangetDragToColumn()
void
setDragToColumn(booleanvalue)
           Indicates whether the specified field can be dragged to the column position. The default value is true.
booleangetDragToData()
void
setDragToData(booleanvalue)
           Indicates whether the specified field can be dragged to the data position. The default value is true.
booleangetDragToHide()
void
setDragToHide(booleanvalue)
           Indicates whether the specified field can be dragged to the hide position. The default value is true.
booleangetDragToPage()
void
setDragToPage(booleanvalue)
           Indicates whether the specified field can be dragged to the page position. The default value is true.
booleangetDragToRow()
void
setDragToRow(booleanvalue)
           Indicates whether the specified field can be dragged to the row position. The default value is true.
intgetFunction()
void
setFunction(intvalue)
           Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.
booleangetInsertBlankRow()
void
setInsertBlankRow(booleanvalue)
           Indicates whether inserting blank line after each item.
booleanisAscendShow()
void
setAscendShow(booleanvalue)
           Indicates whether the specified PivotTable field is autoshown ascending.
booleanisAscendSort()
void
setAscendSort(booleanvalue)
           Indicates whether the specified PivotTable field is autosorted ascending.
booleanisAutoShow()
void
setAutoShow(booleanvalue)
           Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.
booleanisAutoSort()
void
setAutoSort(booleanvalue)
           Indicates whether the specified PivotTable field is automatically sorted.
booleanisAutoSubtotals()
void
setAutoSubtotals(booleanvalue)
           Indicates whether the specified field shows automatic subtotals. Default is true.
booleanisCalculatedField()
Indicates whether the specified PivotTable field is calculated field.
booleanisIncludeNewItemsInFilter()
void
           indicates whether the field can include new items in manual filter The default value is false.
booleanisInsertPageBreaksBetweenItems()
void
           indicates whether the field can insert page breaks between items insert page break after each item The default value is false.
booleanisMultipleItemSelectionAllowed()
void
           indicates whether the field can have multiple items selected in the page field The default value is false.
booleanisRepeatItemLabels()
void
setRepeatItemLabels(booleanvalue)
           indicates whether the field can repeat items labels The default value is false.
intgetItemCount()
Gets the base item count of this pivot field.
java.lang.String[]getItems()
Get all base items;
java.lang.StringgetName()
Represents the PivotField name.
intgetNumber()
void
setNumber(intvalue)
           Represents the built-in display format of numbers and dates.
java.lang.StringgetNumberFormat()
void
setNumberFormat(java.lang.Stringvalue)
           Represents the custom display format of numbers and dates.
java.lang.String[]getOriginalItems()
Get the original base items;
PivotItemCollectiongetPivotItems()
Gets the pivot items of the pivot field
intgetPosition()
Represents the PivotField index in the PivotFields.
SxRnggetRange()
Gets the group range of the pivot field
booleangetShowAllItems()
void
setShowAllItems(booleanvalue)
           Indicates whether all items in the PivotTable report are displayed, even if they don't contain summary data. show items with no data The default value is false.
booleangetShowCompact()
void
setShowCompact(booleanvalue)
          
booleangetShowInOutlineForm()
void
setShowInOutlineForm(booleanvalue)
           Indicates whether layout this field in outline form on the Pivot Table view
booleangetShowSubtotalAtTop()
void
setShowSubtotalAtTop(booleanvalue)
           when ShowInOutlineForm is true, then display subtotals at the top of the list of items instead of at the bottom
 
Method Summary
voidaddCalculatedItem(java.lang.String name, java.lang.String formula)
Add a calculated item to the pivot field.
java.lang.StringgetCalculatedFieldFormula()
Get the formula string of the specified calculated field .
PivotFiltergetPivotFilterByType(int type)
Gets the pivot filter of the pivot field by type
java.util.ArrayListgetPivotFilters()
Gets the pivot filters of the pivot field
booleangetSubtotals(int subtotalType)
Gets whether the specified field shows that subtotals.
voidhideDetail(boolean isHiddenDetail)
Sets whether the PivotItems in a pivot field is hidden detail.That is collapse/expand this field.
voidhideItem(int index, boolean isHidden)
Sets whether the specific PivotItem in a data field is hidden.
voidhideItem(java.lang.String itemValue, boolean isHidden)
Sets whether the specific PivotItem in a data field is hidden.
voidhideItemDetail(int index, boolean isHiddenDetail)
Sets whether the specific PivotItem in a pivot field is hidden detail.
voidinitPivotItems()
Init the pivot items of the pivot field
booleanisHiddenItem(int index)
Indicates whether the specific PivotItem is hidden.
booleanisHiddenItemDetail(int index)
Indicates whether the specific PivotItem is hidden detail.
voidsetSubtotals(int subtotalType, boolean shown)
Sets whether the specified field shows that subtotals.
 

    • Property Getters/Setters Detail

      • getPivotItems

        public PivotItemCollection getPivotItems()
        
        Gets the pivot items of the pivot field
      • getRange

        public SxRng getRange()
        
        Gets the group range of the pivot field
      • isCalculatedField

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

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

        public int getPosition()
        
        Represents the PivotField index in the PivotFields.
      • getName

        public java.lang.String getName()
        
        Represents the PivotField name.
      • getDisplayName/setDisplayName

        public java.lang.String getDisplayName() / public void setDisplayName(java.lang.String value)
        
        Represents the PivotField display name.
      • isAutoSubtotals/setAutoSubtotals

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

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

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

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

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

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

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

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

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

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

        public boolean getShowAllItems() / public void setShowAllItems(boolean value)
        
        Indicates whether all items in the PivotTable report are displayed, even if they don't contain summary data. show items with no data The default value is false.
      • isAutoSort/setAutoSort

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

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

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

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

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

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

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

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

        public int getDataDisplayFormat() / public void setDataDisplayFormat(int value)
        
        Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.PivotFieldDataDisplayFormat
      • getBaseField/setBaseField

        public int getBaseField() / public void setBaseField(int value)
        
        Represents the base field for a custom calculation. Please use PivotField.BaseFieldIndex instead NOTE: This member is now obsolete. Instead, please us PivotField.BaseFieldIndex property. This property will be removed 12 months later since April 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getBaseItem/setBaseItem

        public int getBaseItem() / public void setBaseItem(int value)
        
        Represents the item in the base field for a custom calculation. Valid only for data fields. NOTE: This member is now obsolete. Instead, please us PivotField.BaseItemIndex property. This property will be removed 12 months later since April 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getBaseFieldIndex/setBaseFieldIndex

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

        public int getBaseItemPosition() / public void setBaseItemPosition(int value)
        
        Represents the item in the base field for a custom calculation. Valid only for data fields. Because PivotItemPosition.InnerCustom is only for read,if you need to set PivotItemPosition.InnerCustom, please set PivotField.BaseItemIndex attribute. The value of the property is PivotItemPosition integer constant.PivotItemPosition
      • getBaseItemIndex/setBaseItemIndex

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

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

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

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

        public boolean getShowSubtotalAtTop() / public void setShowSubtotalAtTop(boolean value)
        
        when ShowInOutlineForm is true, then display subtotals at the top of the list of items instead of at the bottom
      • getShowInOutlineForm/setShowInOutlineForm

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

        public java.lang.String getNumberFormat() / public void setNumberFormat(java.lang.String value)
        
        Represents the custom display format of numbers and dates.
      • getItems

        public java.lang.String[] getItems()
        
        Get all base items;
      • getOriginalItems

        public java.lang.String[] getOriginalItems()
        
        Get the original base items;
      • getItemCount

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

        public boolean getShowCompact() / public void setShowCompact(boolean value)
        
    • Method Detail

      • getPivotFilterByType

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

        public java.util.ArrayList getPivotFilters()
        Gets the pivot filters of the pivot field
      • initPivotItems

        public void initPivotItems()
        Init the pivot items of the pivot field
      • getCalculatedFieldFormula

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

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

        public boolean getSubtotals(int subtotalType)
        Gets whether the specified field shows that subtotals.
        Parameters:
        subtotalType - A PivotFieldSubtotalType value. subtotals type.
        Returns:
        whether the specified field shows that subtotals.
      • isHiddenItem

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

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

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

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

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

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

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