PivotField

Inheritance: java.lang.Object

public class PivotField

Represents a field in a PivotTable report.

Example

         Workbook book = new Workbook();
         Worksheet sheet = book.getWorksheets().get(0);
         Cells cells = sheet.getCells();
         cells.get(0, 0).setValue("fruit");
         cells.get(1, 0).setValue("grape");
         cells.get(2, 0).setValue("blueberry");
         cells.get(3, 0).setValue("kiwi");
         cells.get(4, 0).setValue("cherry");
         cells.get(5, 0).setValue("grape");
         cells.get(6, 0).setValue("blueberry");
         cells.get(7, 0).setValue("kiwi");
         cells.get(8, 0).setValue("cherry");
 
         cells.get(0, 1).setValue("year");
         cells.get(1, 1).setValue(2020);
         cells.get(2, 1).setValue(2020);
         cells.get(3, 1).setValue(2020);
         cells.get(4, 1).setValue(2020);
         cells.get(5, 1).setValue(2021);
         cells.get(6, 1).setValue(2021);
         cells.get(7, 1).setValue(2021);
         cells.get(8, 1).setValue(2021);
 
         cells.get(0, 2).setValue("amount");
         cells.get(1, 2).setValue(50);
         cells.get(2, 2).setValue(60);
         cells.get(3, 2).setValue(70);
         cells.get(4, 2).setValue(80);
         cells.get(5, 2).setValue(90);
         cells.get(6, 2).setValue(100);
         cells.get(7, 2).setValue(110);
         cells.get(8, 2).setValue(120);
 
         PivotTableCollection pivots = sheet.getPivotTables();
 
         int pivotIndex = pivots.add("=Sheet1!A1:C9", "A12", "TestPivotTable");
         PivotTable pivot = pivots.get(pivotIndex);
         pivot.addFieldToArea(PivotFieldType.ROW, "fruit");
         pivot.addFieldToArea(PivotFieldType.COLUMN, "year");
         pivot.addFieldToArea(PivotFieldType.DATA, "amount");
 
         pivot.setPivotTableStyleType(PivotTableStyleType.PIVOT_TABLE_STYLE_MEDIUM_10);
 
         //Change PivotField's attributes
         PivotField rowField = pivot.getRowFields().get(0);
         rowField.setDisplayName("custom display name");
 
         pivot.refreshData();
         pivot.calculateData();
 
         //do your business
 
         book.save("out.xlsx");

Methods

MethodDescription
addCalculatedItem(String name, String formula)Add a calculated formula item to the pivot field.
clearFilter()Clears filter setting on this pivot field.
equals(Object arg0)
filterByDate(int type, DateTime dateTime1, DateTime dateTime2)Filters by date values of row or column pivot field.
filterByLabel(int type, String label1, String label2)Filters by captions of row or column pivot field.
filterByValue(int valueFieldIndex, int type, double value1, double value2)Filters by values of data pivot field.
filterTop10(int valueFieldIndex, int type, boolean isTop, int itemCount)Filters by values of data pivot field.
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.
getAutoSortField()Represents the index of field which is auto sorted
getBaseFieldIndex()Represents the base field for a custom calculation when the ShowDataAs calculation is in use.
getBaseIndex()Represents the index in the source pivot fields.
getBaseItemIndex()Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use.
getBaseItemPosition()Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use.
getCalculatedFieldFormula()Get the formula string of the specified calculated field .
getClass()
getCurrentPageItem()Represents the current selected page item of the page field to filter data.
getDataDisplayFormat()Represents how to display the values in a data field of the pivot report.
getDisplayName()Represents the display name of pivot field in the pivot table view.
getDragToColumn()Indicates whether the specified field can be dragged to the column position.
getDragToData()Indicates whether the specified field can be dragged to the values region.
getDragToHide()Indicates whether the specified field can be dragged to the hide region.
getDragToPage()Indicates whether the specified field can be dragged to the page position.
getDragToRow()Indicates whether the specified field can be dragged to the row region.
getFilters()Gets all pivot filters applied for this pivot field.
getFormula()Gets the formula of the calculated field .
getFunction()Represents the function used to summarize this PivotTable data field.
getGroupSettings()Gets the group settings of the pivot field.
getInsertBlankRow()Indicates whether to insert a 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(int type)Gets the pivot filter of the pivot field by type
getPivotFilters()Gets the pivot filters of the pivot field
getPivotItems()Gets the pivot items of the pivot field
getPosition()Represents the index of PivotField in the region.
getRegionType()Specifies the region of the PivotTable that this field is displayed.
getShowAllItems()Indicates whether to display all items in the PivotTable view, even if they don’t contain summary data.
getShowCompact()Indicates whether to display labels of the next field in the same column on the Pivot Table view
getShowInOutlineForm()Indicates whether to layout this field in outline form on the Pivot Table view.
getShowSubtotalAtTop()Indicates whether to display subtotals at the top or bottom of items when ShowInOutlineForm is true, then
getShowValuesSetting()Gets the settings of showing values as when the ShowDataAs calculation is in use.
getSortSetting()Gets all settings of auto sorting
getSubtotals(int subtotalType)Indicates whether to show specified subtotal for this pivot field.
groupBy(CustomPiovtFieldGroupItem[] customGroupItems, boolean newField)Custom group the field.
groupBy(DateTime start, DateTime end, int[] groups, double interval, boolean firstAsNewField)Group the file by the date group types.
groupBy(double interval, boolean newField)Automatically group the field with internal
groupBy(double start, double end, double interval, boolean newField)Group the file by number.
hashCode()
hideDetail(boolean isHiddenDetail)Sets whether the detail of all PivotItems in a pivot field are hidden.
hideItem(int index, boolean isHidden)Sets whether the specific PivotItem in a data field is hidden.
hideItem(String itemValue, boolean isHidden)Sets whether the specific PivotItem in a data field is hidden.
hideItemDetail(int index, boolean isHiddenDetail)Sets whether the specific PivotItem in a pivot field is hidden detail.
initPivotItems()Init the pivot items of the pivot field
isAscendShow()Indicates whether the specified PivotTable field is autoshown ascending.
isAscendSort()Indicates whether the items of this pivot field is autosorted ascending.
isAutoShow()Indicates whether the specified PivotTable field is automatically shown.
isAutoSort()Indicates whether the items of this PivotTable field are automatically sorted.
isAutoSubtotals()Indicates whether the specified field shows automatic subtotals.
isCalculatedField()Indicates whether the this pivot field is calculated field.
isHiddenItem(int index)Gets whether the specific PivotItem is hidden.
isHiddenItemDetail(int index)Gets whether to hide the detail of the specific PivotItem..
isIncludeNewItemsInFilter()Indicates whether to include new items to the field in manual filter.
isInsertPageBreaksBetweenItems()Indicates whether to insert page breaks after each item.
isMultipleItemSelectionAllowed()Indicates whether multiple items could be selected in the page field.
isRepeatItemLabels()Indicates whether to repeat labels of the field in the region.
isValueFields()Indicates whether this field represents values fields.
isValuesField()Indicates whether this field represents values field.
notify()
notifyAll()
setAscendShow(boolean value)Indicates whether the specified PivotTable field is autoshown ascending.
setAscendSort(boolean value)Indicates whether the items of this pivot field is autosorted ascending.
setAutoShow(boolean value)Indicates whether the specified PivotTable field is automatically shown.
setAutoShowCount(int value)Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.
setAutoShowField(int value)Represents auto show field index. -1 means PivotField itself.
setAutoSort(boolean value)Indicates whether the items of this PivotTable field are automatically sorted.
setAutoSortField(int value)Represents the index of field which is auto sorted
setAutoSubtotals(boolean value)Indicates whether the specified field shows automatic subtotals.
setBaseFieldIndex(int value)Represents the base field for a custom calculation when the ShowDataAs calculation is in use.
setBaseIndex(int value)Represents the index in the source pivot fields.
setBaseItemIndex(int value)Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use.
setBaseItemPosition(int value)Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use.
setCurrentPageItem(short value)Represents the current selected page item of the page field to filter data.
setDataDisplayFormat(int value)Represents how to display the values in a data field of the pivot report.
setDisplayName(String value)Represents the display name of pivot field in the pivot table view.
setDragToColumn(boolean value)Indicates whether the specified field can be dragged to the column position.
setDragToData(boolean value)Indicates whether the specified field can be dragged to the values region.
setDragToHide(boolean value)Indicates whether the specified field can be dragged to the hide region.
setDragToPage(boolean value)Indicates whether the specified field can be dragged to the page position.
setDragToRow(boolean value)Indicates whether the specified field can be dragged to the row region.
setFunction(int value)Represents the function used to summarize this PivotTable data field.
setIncludeNewItemsInFilter(boolean value)Indicates whether to include new items to the field in manual filter.
setInsertBlankRow(boolean value)Indicates whether to insert a blank line after each item.
setInsertPageBreaksBetweenItems(boolean value)Indicates whether to insert page breaks after each item.
setMultipleItemSelectionAllowed(boolean value)Indicates whether multiple items could be selected in the page field.
setName(String value)Represents the name of PivotField.
setNonAutoSortDefault(boolean value)Indicates whether a sort operation that will be applied to this pivot field is an autosort operation or a simple data sort.
setNumber(int value)Represents the built-in display format of numbers and dates.
setNumberFormat(String value)Represents the custom display format of numbers and dates.
setRepeatItemLabels(boolean value)Indicates whether to repeat labels of the field in the region.
setShowAllItems(boolean value)Indicates whether to display all items in the PivotTable view, even if they don’t contain summary data.
setShowCompact(boolean value)Indicates whether to display labels of the next field in the same column on the Pivot Table view
setShowInOutlineForm(boolean value)Indicates whether to layout this field in outline form on the Pivot Table view.
setShowSubtotalAtTop(boolean value)Indicates whether to display subtotals at the top or bottom of items when ShowInOutlineForm is true, then
setSubtotals(int subtotalType, boolean shown)Sets how to subtotal the specified field.
showValuesAs(int displayFormat, int baseField, int baseItemPositionType, int baseItem)Shows values of data field as different display format when the ShowDataAs calculation is in use.
sortBy(int sortType, int fieldSortedBy)Sorts this pivot field.
sortBy(int sortType, int fieldSortedBy, int dataType, String cellName)Sorts this pivot field.
toString()
ungroup()Ungroup the pivot field.
wait()
wait(long arg0)
wait(long arg0, int arg1)

addCalculatedItem(String name, String formula)

public void addCalculatedItem(String name, String formula)

Add a calculated formula item to the pivot field.

Remarks

Only supports to add calculated item to Row/Column field.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe item’s name.
formulajava.lang.StringThe formula of pivot item.

clearFilter()

public void clearFilter()

Clears filter setting on this pivot field.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

filterByDate(int type, DateTime dateTime1, DateTime dateTime2)

public PivotFilter filterByDate(int type, DateTime dateTime1, DateTime dateTime2)

Filters by date values of row or column pivot field.

Parameters:

ParameterTypeDescription
typeintPivotFilterType. The type of filtering data.
dateTime1DateTimeThe date label of filter condition
dateTime2DateTimeThe upper-bound date label of between filter condition

Returns: PivotFilter

filterByLabel(int type, String label1, String label2)

public PivotFilter filterByLabel(int type, String label1, String label2)

Filters by captions of row or column pivot field.

Parameters:

ParameterTypeDescription
typeintPivotFilterType. The type of filtering data.
label1java.lang.StringThe label of filter condition
label2java.lang.StringThe upper-bound label of between filter condition

Returns: PivotFilter

filterByValue(int valueFieldIndex, int type, double value1, double value2)

public PivotFilter filterByValue(int valueFieldIndex, int type, double value1, double value2)

Filters by values of data pivot field.

Parameters:

ParameterTypeDescription
valueFieldIndexintThe index of value field in the value region.
typeintPivotFilterType. The type of filtering data.
value1doubleThe value of filter condition
value2doubleThe upper-bound value of between filter condition

Returns: PivotFilter

filterTop10(int valueFieldIndex, int type, boolean isTop, int itemCount)

public PivotFilter filterTop10(int valueFieldIndex, int type, boolean isTop, int itemCount)

Filters by values of data pivot field.

Parameters:

ParameterTypeDescription
valueFieldIndexintThe index of data field in the data region.
typeintPivotFilterType. The type of filtering data. Only can be Count,Sum and Percent.
isTopbooleanIndicates whether filter from top or bottom
itemCountintThe item count

Returns: PivotFilter

getAutoShowCount()

public int getAutoShowCount()

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

Returns: int

getAutoShowField()

public int getAutoShowField()

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

Returns: int

getAutoSortField()

public int getAutoSortField()

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

Returns: int

getBaseFieldIndex()

public int getBaseFieldIndex()

Represents the base field for a custom calculation when the ShowDataAs calculation is in use.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseFieldIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getBaseIndex()

public int getBaseIndex()

Represents the index in the source pivot fields.

Returns: int

getBaseItemIndex()

public int getBaseItemIndex()

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseItemIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getBaseItemPosition()

public int 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.

See PivotItemPosition.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseItemPositionType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getCalculatedFieldFormula()

public String getCalculatedFieldFormula()

Get the formula string of the specified calculated field .

Remarks

NOTE: This method is now obsolete. Instead, please use PivotField.GetFormula() method. This method will be removed 12 months later since August 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.lang.String

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCurrentPageItem()

public short getCurrentPageItem()

Represents the current selected page item of the page field to filter data. Only valid for page fields.

Returns: short

getDataDisplayFormat()

public int getDataDisplayFormat()

Represents how to display the values in a data field of the pivot report.

See PivotFieldDataDisplayFormat.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.CalculationType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Returns: int

getDisplayName()

public String getDisplayName()

Represents the display name of pivot field in the pivot table view.

Returns: java.lang.String

getDragToColumn()

public boolean getDragToColumn()

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

Returns: boolean

getDragToData()

public boolean getDragToData()

Indicates whether the specified field can be dragged to the values region. The default value is true.

Returns: boolean

getDragToHide()

public boolean getDragToHide()

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

Returns: boolean

getDragToPage()

public boolean getDragToPage()

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

Returns: boolean

getDragToRow()

public boolean getDragToRow()

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

Returns: boolean

getFilters()

public PivotFilter[] getFilters()

Gets all pivot filters applied for this pivot field.

Returns: com.aspose.cells.PivotFilter[]

getFormula()

public String getFormula()

Gets the formula of the calculated field . Only works for calculated field.

Returns: java.lang.String

getFunction()

public int getFunction()

Represents the function used to summarize this PivotTable data field.

See ConsolidationFunction.

Returns: int

getGroupSettings()

public PivotFieldGroupSettings getGroupSettings()

Gets the group settings of the pivot field.

Remarks

If this field is not grouped, Null will be returned.

Returns: PivotFieldGroupSettings

getInsertBlankRow()

public boolean getInsertBlankRow()

Indicates whether to insert a blank line after each item.

Returns: boolean

getItemCount()

public int getItemCount()

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

Returns: int

getItems()

public String[] getItems()

Get all labels of pivot items in this field.

Returns: java.lang.String[]

getName()

public String getName()

Represents the name of PivotField.

Returns: java.lang.String

getNonAutoSortDefault()

public boolean getNonAutoSortDefault()

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

Returns: boolean

getNumber()

public int getNumber()

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

Returns: int

getNumberFormat()

public String getNumberFormat()

Represents the custom display format of numbers and dates.

Returns: java.lang.String

getOriginalItems()

public String[] getOriginalItems()

Get the original base items;

Returns: java.lang.String[]

getPivotFilterByType(int type)

public PivotFilter getPivotFilterByType(int type)

Gets the pivot filter of the pivot field by type

Parameters:

ParameterTypeDescription
typeint

Returns: PivotFilter

getPivotFilters()

public ArrayList getPivotFilters()

Gets the pivot filters of the pivot field

Remarks

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.

Returns: java.util.ArrayList

getPivotItems()

public PivotItemCollection getPivotItems()

Gets the pivot items of the pivot field

Returns: PivotItemCollection

getPosition()

public int getPosition()

Represents the index of PivotField in the region.

Returns: int

getRegionType()

public int getRegionType()

Specifies the region of the PivotTable that this field is displayed.

See PivotFieldType.

Returns: int

getShowAllItems()

public boolean getShowAllItems()

Indicates whether to display all items in the PivotTable view, even if they don’t contain summary data. The default value is false.

Returns: boolean

getShowCompact()

public boolean getShowCompact()

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

Returns: boolean

getShowInOutlineForm()

public boolean getShowInOutlineForm()

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

Returns: boolean

getShowSubtotalAtTop()

public boolean getShowSubtotalAtTop()

Indicates whether to display subtotals at the top or bottom of items when ShowInOutlineForm is true, then

Remarks

Only works when ShowInOutlineForm is true.

Returns: boolean

getShowValuesSetting()

public PivotShowValuesSetting getShowValuesSetting()

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

Returns: PivotShowValuesSetting

getSortSetting()

public PivotFieldSortSetting getSortSetting()

Gets all settings of auto sorting

Returns: PivotFieldSortSetting

getSubtotals(int subtotalType)

public boolean getSubtotals(int subtotalType)

Indicates whether to show specified subtotal for this pivot field.

Parameters:

ParameterTypeDescription
subtotalTypeintPivotFieldSubtotalType. Subtotal type.

Returns: boolean - Returns whether showing specified subtotal.

groupBy(CustomPiovtFieldGroupItem[] customGroupItems, boolean newField)

public boolean groupBy(CustomPiovtFieldGroupItem[] customGroupItems, boolean newField)

Custom group the field.

Parameters:

ParameterTypeDescription
customGroupItemsCustomPiovtFieldGroupItem[]The custom group items.
newFieldbooleanIndicates whether adding a new field to the pivottable

Returns: boolean - False means this field could not be grouped by date time.

groupBy(DateTime start, DateTime end, int[] groups, double interval, boolean firstAsNewField)

public boolean groupBy(DateTime start, DateTime end, int[] groups, double interval, boolean firstAsNewField)

Group the file by the date group types.

Parameters:

ParameterTypeDescription
startDateTimeThe start datetime
endDateTimeThe end of datetime
groupsint[]PivotGroupByType. Group types
intervaldoubleThe interval
firstAsNewFieldbooleanIndicates whether adding a new field to the pivottable. Only for the first group item.

Returns: boolean - False means this field could not be grouped by date time.

groupBy(double interval, boolean newField)

public void groupBy(double interval, boolean newField)

Automatically group the field with internal

Parameters:

ParameterTypeDescription
intervaldoubleThe internal of group. Automatic value will be assigned if it’s zero,
newFieldbooleanIndicates whether adding a new field to the pivottable.

groupBy(double start, double end, double interval, boolean newField)

public boolean groupBy(double start, double end, double interval, boolean newField)

Group the file by number.

Parameters:

ParameterTypeDescription
startdoubleThe start value
enddoubleThe end of value
intervaldoubleThe interval
newFieldbooleanIndicates whether adding a new field to the pivottable

Returns: boolean - False means this field could not be grouped by date time.

hashCode()

public native int hashCode()

Returns: int

hideDetail(boolean isHiddenDetail)

public void hideDetail(boolean isHiddenDetail)

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

Parameters:

ParameterTypeDescription
isHiddenDetailbooleanWhether hide the detail of the pivot field.

hideItem(int index, boolean isHidden)

public void hideItem(int index, boolean isHidden)

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

Parameters:

ParameterTypeDescription
indexintthe index of the pivotItem in the pivotField.
isHiddenbooleanwhether the specific PivotItem is hidden

hideItem(String itemValue, boolean isHidden)

public void hideItem(String itemValue, boolean isHidden)

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

Parameters:

ParameterTypeDescription
itemValuejava.lang.StringThe name of the pivotItem in the pivotField.
isHiddenbooleanWhether the specific PivotItem is hidden

hideItemDetail(int index, boolean isHiddenDetail)

public void hideItemDetail(int index, boolean isHiddenDetail)

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

Parameters:

ParameterTypeDescription
indexintthe index of the pivotItem in the pivotField.
isHiddenDetailbooleanwhether the specific PivotItem is hidden

initPivotItems()

public void initPivotItems()

Init the pivot items of the pivot field

isAscendShow()

public boolean isAscendShow()

Indicates whether the specified PivotTable field is autoshown ascending.

Returns: boolean

isAscendSort()

public boolean isAscendSort()

Indicates whether the items of this pivot field is autosorted ascending.

Returns: boolean

isAutoShow()

public boolean isAutoShow()

Indicates whether the specified PivotTable field is automatically shown.

Remarks

Only valid for excel 2003.

Returns: boolean

isAutoSort()

public boolean isAutoSort()

Indicates whether the items of this PivotTable field are automatically sorted.

Returns: boolean

isAutoSubtotals()

public boolean isAutoSubtotals()

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

Returns: boolean

isCalculatedField()

public boolean isCalculatedField()

Indicates whether the this pivot field is calculated field.

Returns: boolean

isHiddenItem(int index)

public boolean isHiddenItem(int index)

Gets whether the specific PivotItem is hidden.

Parameters:

ParameterTypeDescription
indexintThe index of the pivotItem in the pivotField.

Returns: boolean - whether the specific PivotItem is hidden

isHiddenItemDetail(int index)

public boolean isHiddenItemDetail(int index)

Gets whether to hide the detail of the specific PivotItem..

Parameters:

ParameterTypeDescription
indexintThe index of the pivotItem in the pivotField.

Returns: boolean - whether the specific PivotItem is hidden detail

isIncludeNewItemsInFilter()

public boolean isIncludeNewItemsInFilter()

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

Returns: boolean

isInsertPageBreaksBetweenItems()

public boolean isInsertPageBreaksBetweenItems()

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

Returns: boolean

isMultipleItemSelectionAllowed()

public boolean isMultipleItemSelectionAllowed()

Indicates whether multiple items could be selected in the page field. The default value is false.

Returns: boolean

isRepeatItemLabels()

public boolean isRepeatItemLabels()

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

Returns: boolean

isValueFields()

public boolean isValueFields()

Indicates whether this field represents values fields.

Remarks

NOTE: This method is now obsolete. Instead, please use PivotField.IsValuesField property. This method will be removed 12 months later since November 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns: boolean

isValuesField()

public boolean isValuesField()

Indicates whether this field represents values field.

Remarks

Only works when there are two or more data fields in the pivot table view.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAscendShow(boolean value)

public void setAscendShow(boolean value)

Indicates whether the specified PivotTable field is autoshown ascending.

Parameters:

ParameterTypeDescription
valueboolean

setAscendSort(boolean value)

public void setAscendSort(boolean value)

Indicates whether the items of this pivot field is autosorted ascending.

Parameters:

ParameterTypeDescription
valueboolean

setAutoShow(boolean value)

public void setAutoShow(boolean value)

Indicates whether the specified PivotTable field is automatically shown.

Remarks

Only valid for excel 2003.

Parameters:

ParameterTypeDescription
valueboolean

setAutoShowCount(int value)

public void setAutoShowCount(int value)

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

Parameters:

ParameterTypeDescription
valueint

setAutoShowField(int value)

public void setAutoShowField(int value)

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

Parameters:

ParameterTypeDescription
valueint

setAutoSort(boolean value)

public void setAutoSort(boolean value)

Indicates whether the items of this PivotTable field are automatically sorted.

Parameters:

ParameterTypeDescription
valueboolean

setAutoSortField(int value)

public void setAutoSortField(int value)

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

Parameters:

ParameterTypeDescription
valueint

setAutoSubtotals(boolean value)

public void setAutoSubtotals(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setBaseFieldIndex(int value)

public void setBaseFieldIndex(int value)

Represents the base field for a custom calculation when the ShowDataAs calculation is in use.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseFieldIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setBaseIndex(int value)

public void setBaseIndex(int value)

Represents the index in the source pivot fields.

Parameters:

ParameterTypeDescription
valueint

setBaseItemIndex(int value)

public void setBaseItemIndex(int value)

Represents the item in the base field for a custom calculation when the ShowDataAs calculation is in use. Valid only for data fields.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseItemIndex property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setBaseItemPosition(int value)

public void setBaseItemPosition(int value)

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.

See PivotItemPosition.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.BaseItemPositionType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setCurrentPageItem(short value)

public void setCurrentPageItem(short value)

Represents the current selected page item of the page field to filter data. Only valid for page fields.

Parameters:

ParameterTypeDescription
valueshort

setDataDisplayFormat(int value)

public void setDataDisplayFormat(int value)

Represents how to display the values in a data field of the pivot report.

See PivotFieldDataDisplayFormat.

Remarks

NOTE: This property is now obsolete. Instead, please use PivotField.ShowValuesSetting.CalculationType property instead. This method will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueint

setDisplayName(String value)

public void setDisplayName(String value)

Represents the display name of pivot field in the pivot table view.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setDragToColumn(boolean value)

public void setDragToColumn(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setDragToData(boolean value)

public void setDragToData(boolean value)

Indicates whether the specified field can be dragged to the values region. The default value is true.

Parameters:

ParameterTypeDescription
valueboolean

setDragToHide(boolean value)

public void setDragToHide(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setDragToPage(boolean value)

public void setDragToPage(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setDragToRow(boolean value)

public void setDragToRow(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setFunction(int value)

public void setFunction(int value)

Represents the function used to summarize this PivotTable data field.

See ConsolidationFunction.

Parameters:

ParameterTypeDescription
valueint

setIncludeNewItemsInFilter(boolean value)

public void setIncludeNewItemsInFilter(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setInsertBlankRow(boolean value)

public void setInsertBlankRow(boolean value)

Indicates whether to insert a blank line after each item.

Parameters:

ParameterTypeDescription
valueboolean

setInsertPageBreaksBetweenItems(boolean value)

public void setInsertPageBreaksBetweenItems(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setMultipleItemSelectionAllowed(boolean value)

public void setMultipleItemSelectionAllowed(boolean value)

Indicates whether multiple items could be selected in the page field. The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setName(String value)

public void setName(String value)

Represents the name of PivotField.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setNonAutoSortDefault(boolean value)

public void setNonAutoSortDefault(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setNumber(int value)

public void setNumber(int value)

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

Parameters:

ParameterTypeDescription
valueint

setNumberFormat(String value)

public void setNumberFormat(String value)

Represents the custom display format of numbers and dates.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setRepeatItemLabels(boolean value)

public void setRepeatItemLabels(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setShowAllItems(boolean value)

public void setShowAllItems(boolean value)

Indicates whether to display all items in the PivotTable view, even if they don’t contain summary data. The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setShowCompact(boolean value)

public void setShowCompact(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setShowInOutlineForm(boolean value)

public void setShowInOutlineForm(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

setShowSubtotalAtTop(boolean value)

public void setShowSubtotalAtTop(boolean value)

Indicates whether to display subtotals at the top or bottom of items when ShowInOutlineForm is true, then

Remarks

Only works when ShowInOutlineForm is true.

Parameters:

ParameterTypeDescription
valueboolean

setSubtotals(int subtotalType, boolean shown)

public void setSubtotals(int subtotalType, boolean shown)

Sets how to subtotal the specified field.

Parameters:

ParameterTypeDescription
subtotalTypeintPivotFieldSubtotalType. PivotFieldSubtotalType
shownbooleanWhether the specified field shows that subtotals.

showValuesAs(int displayFormat, int baseField, int baseItemPositionType, int baseItem)

public void showValuesAs(int displayFormat, int baseField, int baseItemPositionType, int baseItem)

Shows values of data field as different display format when the ShowDataAs calculation is in use.

Remarks

Only for data field.

Parameters:

ParameterTypeDescription
displayFormatintPivotFieldDataDisplayFormat. The data display format type.
baseFieldintThe index to the field which ShowDataAs calculation bases on.
baseItemPositionTypeintPivotItemPositionType. The position type of base iteam.
baseItemintThe index to the base item which ShowDataAs calculation bases on. Only works when baseItemPositionType is custom.

sortBy(int sortType, int fieldSortedBy)

public void sortBy(int sortType, int fieldSortedBy)

Sorts this pivot field.

Parameters:

ParameterTypeDescription
sortTypeintSortOrder. The type of sorting this field.
fieldSortedByintThe index of pivot field sorted by. -1 means sorting by data labels of this field, others mean the index of data field sorted by.

sortBy(int sortType, int fieldSortedBy, int dataType, String cellName)

public void sortBy(int sortType, int fieldSortedBy, int dataType, String cellName)

Sorts this pivot field.

Parameters:

ParameterTypeDescription
sortTypeintSortOrder. The type of sorting this field.
fieldSortedByintThe index of pivot field sorted by. -1 means sorting by data labels of this field, others mean the index of data field sorted by.
dataTypeintPivotLineType. The type of data sorted by.
cellNamejava.lang.StringSort by values in the row or column

toString()

public String toString()

Returns: java.lang.String

ungroup()

public void ungroup()

Ungroup the pivot field.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int