com.aspose.cells
Class PivotField

java.lang.Object
    extended by com.aspose.cells.PivotField

public class PivotField 
extends java.lang.Object

Represents a field in a PivotTable report.

Property Getters/Setters Summary
intgetAutoShowCount()
voidsetAutoShowCount(int value)
           Represent the number of top or bottom items that are automatically shown in the specified PivotTable field.
intgetAutoShowField()
voidsetAutoShowField(int value)
           Represents auto show field index. -1 means PivotField itself. It should be the index of the data fields.
intgetAutoSortField()
voidsetAutoSortField(int value)
           Represents auto sort field index. -1 means PivotField itself,others means the position of the data fields.
intgetBaseField()
voidsetBaseField(int value)
           Represents the base field for a custom calculation.
intgetBaseIndex()
voidsetBaseIndex(int value)
           Represents the PivotField index in the base PivotFields.
intgetBaseItem()
voidsetBaseItem(int value)
           Represents the item in the base field for a custom calculation. Valid only for data fields.
intgetBaseItemPosition()
voidsetBaseItemPosition(int value)
           Represents the item in the base field for a custom calculation. Valid only for data fields. The value of the property is PivotItemPosition integer constant.
shortgetCurrentPageItem()
voidsetCurrentPageItem(short value)
           Represents the current page item showing for the page field (valid only for page fields).
intgetDataDisplayFormat()
voidsetDataDisplayFormat(int value)
           Represents how to display the values contained in a data field. The value of the property is PivotFieldDataDisplayFormat integer constant.
java.lang.StringgetDisplayName()
voidsetDisplayName(java.lang.String value)
           Represents the PivotField display name.
booleangetDragToColumn()
voidsetDragToColumn(boolean value)
           Indicates whether the specified field can be dragged to the column position. The default value is true.
booleangetDragToData()
voidsetDragToData(boolean value)
           Indicates whether the specified field can be dragged to the data position. The default value is true.
booleangetDragToHide()
voidsetDragToHide(boolean value)
           Indicates whether the specified field can be dragged to the hide position. The default value is true.
booleangetDragToPage()
voidsetDragToPage(boolean value)
           Indicates whether the specified field can be dragged to the page position. The default value is true.
booleangetDragToRow()
voidsetDragToRow(boolean value)
           Indicates whether the specified field can be dragged to the row position. The default value is true.
intgetFunction()
voidsetFunction(int value)
           Represents the function used to summarize the PivotTable data field. The value of the property is ConsolidationFunction integer constant.
booleangetInsertBlankRow()
voidsetInsertBlankRow(boolean value)
           Indicates whether inserting blank line after each item.
booleanisAscendShow()
voidsetAscendShow(boolean value)
           Indicates whether the specified PivotTable field is autoshown ascending.
booleanisAscendSort()
voidsetAscendSort(boolean value)
           Indicates whether the specified PivotTable field is autosorted ascending.
booleanisAutoShow()
voidsetAutoShow(boolean value)
           Indicates whether the specified PivotTable field is automatically shown,only valid for excel 2003.
booleanisAutoSort()
voidsetAutoSort(boolean value)
           Indicates whether the specified PivotTable field is automatically sorted.
booleanisAutoSubtotals()
voidsetAutoSubtotals(boolean value)
           Indicates whether the specified field shows automatic subtotals. Default is true.
booleanisCalculatedField()
           Indicates whether the specified PivotTable field is calculated field.
booleanisIncludeNewItemsInFilter()
voidsetIncludeNewItemsInFilter(boolean value)
           indicates whether the field can include new items in manual filter The default value is false.
booleanisInsertPageBreaksBetweenItems()
voidsetInsertPageBreaksBetweenItems(boolean value)
           indicates whether the field can insert page breaks between items insert page break after each item The default value is false.
booleanisMultipleItemSelectionAllowed()
voidsetMultipleItemSelectionAllowed(boolean value)
           indicates whether the field can have multiple items selected in the page field The default value is false.
booleanisRepeatItemLabels()
voidsetRepeatItemLabels(boolean value)
           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()
voidsetNumber(int value)
           Represents the built-in display format of numbers and dates.
java.lang.StringgetNumberFormat()
voidsetNumberFormat(java.lang.String value)
           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()
voidsetShowAllItems(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.
booleangetShowCompact()
voidsetShowCompact(boolean value)
          
booleangetShowInOutlineForm()
voidsetShowInOutlineForm(boolean value)
           Indicates whether layout this field in outline form on the Pivot Table view
booleangetShowSubtotalAtTop()
voidsetShowSubtotalAtTop(boolean value)
           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.
booleandragToColumn()
           Indicates whether the specified field can be dragged to the column position. The default value is true.
booleandragToHide()
           Indicates whether the specified field can be dragged to the hide position. The default value is true.
booleandragToPage()
           Indicates whether the specified field can be dragged to the page position. The default value is true.
booleandragToRow()
           Indicates whether the specified field can be dragged to the row position. The default value is true.
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.
booleanshowAllItems()
           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.
 

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.

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. The value of the property is PivotItemPosition integer constant.PivotItemPosition

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.

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.

dragToColumn

public boolean dragToColumn()
Indicates whether the specified field can be dragged to the column position. The default value is true. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Pivot.PivotField.DragToColumn property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.

dragToHide

public boolean dragToHide()
Indicates whether the specified field can be dragged to the hide position. The default value is true. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Pivot.PivotField.DragToHide property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.

dragToRow

public boolean dragToRow()
Indicates whether the specified field can be dragged to the row position. The default value is true. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Pivot.PivotField.DragToRow property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.

dragToPage

public boolean dragToPage()
Indicates whether the specified field can be dragged to the page position. The default value is true. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Pivot.PivotField.DragToPage property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.

showAllItems

public boolean showAllItems()
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. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Pivot.PivotField.ShowAllItems property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.

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

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.