public class PivotTable
extends java.lang.Object
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");
//Add PivotFilter
int index = pivot.getPivotFilters().add(0, PivotFilterType.COUNT);
PivotFilter filter = pivot.getPivotFilters().get(index);
filter.getAutoFilter().filterTop10(0, false, false, 2);
//Add PivotFormatCondition
int formatIndex = pivot.getPivotFormatConditions().add();
PivotFormatCondition pfc = pivot.getPivotFormatConditions().get(formatIndex);
FormatConditionCollection fcc = pfc.getFormatConditions();
fcc.addArea(pivot.getDataBodyRange());
int idx = fcc.addCondition(FormatConditionType.CELL_VALUE);
FormatCondition fc = fcc.get(idx);
fc.setFormula1("100");
fc.setOperator(OperatorType.GREATER_OR_EQUAL);
fc.getStyle().setBackgroundColor(Color.getRed());
pivot.refreshData();
pivot.calculateData();
//do your business
book.save("out.xlsx");
| Modifier and Type | Method and Description |
|---|---|
void |
addCalculatedField(java.lang.String name,
java.lang.String formula)
Adds a calculated field to pivot field and drag it to data area.
|
void |
addCalculatedField(java.lang.String name,
java.lang.String formula,
boolean dragToDataArea)
Adds a calculated field to pivot field.
|
int |
addFieldToArea(int fieldType,
int baseFieldIndex)
Adds the field to the specific area.
|
int |
addFieldToArea(int fieldType,
PivotField pivotField)
Adds the field to the specific area.
|
int |
addFieldToArea(int fieldType,
java.lang.String fieldName)
Adds the field to the specific area.
|
void |
calculateData()
Calculates pivottable's data to cells.
|
void |
calculateData(PivotTableCalculateOption option)
Calculating pivot tables with options
|
void |
calculateRange()
Calculates pivottable's range.
|
void |
changeDataSource(java.lang.String[] source)
Set pivottable's source data.
|
void |
clearData()
Clear PivotTable's data and formatting
|
void |
copyStyle(PivotTable pivotTable)
Copies named style from another pivot table.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or
resetting unmanaged resources.
|
PivotFieldCollection |
fields(int fieldType)
Deprecated.
Use PivotField.GetFields() method instead.
|
void |
format(CellArea ca,
Style style)
Formats selected area of the PivotTable.
|
void |
format(int row,
int column,
Style style)
Format the cell in the pivottable area
|
void |
format(PivotArea pivotArea,
Style style)
Formats selected area of the PivotTable.
|
void |
formatAll(Style style)
Format all the cell in the pivottable area
|
void |
formatRow(int row,
Style style)
Format the row data in the pivottable area
|
boolean |
getAllowMultipleFiltersPerField()
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
java.lang.String |
getAltTextDescription()
Gets the description of the alt text.
|
java.lang.String |
getAltTextTitle()
Gets the title of the alter text.
|
boolean |
getAutofitColumnWidthOnUpdate()
Indicates whether autofitting column width on update
|
int |
getAutoFormatType()
Gets the auto format type of PivotTable.
|
PivotFieldCollection |
getBaseFields()
Returns all base pivot fields in the PivotTable.
|
Cell |
getCellByDisplayName(java.lang.String displayName)
Gets the
Cell object by the display name of PivotField. |
PivotTable[] |
getChildren()
Gets the Children Pivot Tables which use this PivotTable data as data source.
|
PivotFieldCollection |
getColumnFields()
Returns a PivotFields object that are currently shown as column fields.
|
boolean |
getColumnGrand()
Deprecated.
Use PivotTable.ShowColumnGrandTotals property instead.
|
java.lang.String |
getColumnHeaderCaption()
Gets the Column Header Caption of the PivotTable.
|
CellArea |
getColumnRange()
Returns a CellArea object that represents the range
that contains the column area in the PivotTable report.
|
PivotConditionalFormatCollection |
getConditionalFormats()
Gets the conditional formats of the pivot table.
|
boolean |
getCustomListSort()
Indicates whether consider built-in custom list when sort data
|
CellArea |
getDataBodyRange()
Returns a
CellArea object that represents the range that contains the data area
in the list between the header row and the insert row. |
PivotField |
getDataField()
Gets a
PivotField object that represents all the data fields in a PivotTable. |
java.lang.String |
getDataFieldHeaderName()
Gets the name of the value area field header in the PivotTable.
|
PivotFieldCollection |
getDataFields()
Gets a PivotField object that represents all the data fields in a PivotTable.
|
java.lang.String[] |
getDataSource()
Gets the data source of the pivot table.
|
boolean |
getDisplayErrorString()
Indicates whether the PivotTable report displays a custom string in cells that contain errors.
|
boolean |
getDisplayImmediateItems()
Indicates whether items in the row and column areas are visible
when the data area of the PivotTable is empty.
|
boolean |
getDisplayNullString()
Indicates whether the PivotTable report displays a custom string if the value is null.
|
boolean |
getEnableDataValueEditing()
Specifies a boolean value that indicates whether the user is allowed to edit the cells in the data area of the pivottable.
|
boolean |
getEnableDrilldown()
Gets whether drilldown is enabled.
|
boolean |
getEnableFieldDialog()
Indicates whether the PivotTable Field dialog box is available
when the user double-clicks the PivotTable field.
|
boolean |
getEnableFieldList()
Indicates whether the field list for the PivotTable is available on the view of Excel.
|
boolean |
getEnableWizard()
Indicates whether the PivotTable Wizard is available.
|
java.lang.String |
getErrorString()
Gets the string displayed in cells that contain errors
when the DisplayErrorString property is true.The default value is an empty string.
|
ExternalConnection |
getExternalConnectionDataSource()
Deprecated.
Use PivotTable.GetSourceDataConnections() method instead.
|
boolean |
getFieldListSortAscending()
Indicates whether fields in the PivotTable are sorted in non-default order in the field list.
|
PivotFieldCollection |
getFields(int fieldType)
Gets the specific pivot field list by the region.
|
java.lang.String |
getGrandTotalName()
Returns the label that is displayed in the grand total column or row heading.
|
java.util.ArrayList |
getHorizontalBreaks()
Deprecated.
Use ivotTable.GetHorizontalPageBreaks() method instead.
|
int[] |
getHorizontalPageBreaks()
Gets horizontal page breaks of this pivot table.
|
int |
getIndent()
Specifies the indentation increment for compact axis and can be used to set the Report Layout to Compact Form.
|
boolean |
getItemPrintTitles()
Deprecated.
Use PivotTable.RepeatItemsOnEachPrintedPage property instead.
|
boolean |
getManualUpdate()
Indicates whether the PivotTable report is recalculated only at the user's request.
|
boolean |
getMergeLabels()
True if the specified PivotTable report's outer-row item, column item, subtotal, and grand total labels use merged cells.
|
int |
getMissingItemsLimit()
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
java.lang.String |
getName()
Gets the name of the PivotTable
|
java.lang.String[] |
getNamesOfSourceDataConnections()
Gets the name of external source data connections.
|
java.lang.String |
getNullString()
Gets the string displayed in cells that contain null values
when the DisplayNullString property is true.The default value is an empty string.
|
int |
getPageFieldOrder()
Gets the order in which page fields are added to the PivotTable report's layout.
|
PivotFieldCollection |
getPageFields()
Returns a PivotFields object that are currently shown as page fields.
|
int |
getPageFieldWrapCount()
Gets the number of page fields in each column or row in the PivotTable report.
|
PivotFilterCollection |
getPivotFilters()
Returns all filters of pivot fields in the pivot table.
|
PivotFormatConditionCollection |
getPivotFormatConditions()
Deprecated.
Use PivotTable.ConditionalFormats property instead.
|
PivotTableFormatCollection |
getPivotFormats()
Gets the collection of formats applied to PivotTable.
|
java.lang.String |
getPivotTableStyleName()
Gets the pivottable style name.
|
int |
getPivotTableStyleType()
Gets the built-in pivot table style.
|
boolean |
getPreserveFormatting()
Indicates whether formatting is preserved when the PivotTable is refreshed or recalculated.
|
boolean |
getPrintDrill()
Specifies a boolean value that indicates whether drill indicators should be printed.
|
boolean |
getPrintTitles()
Indicates whether the print titles for the worksheet are set based
on the PivotTable report.
|
boolean |
getRefreshDataFlag()
Deprecated.
Simply remove this calling.
|
boolean |
getRefreshDataOnOpeningFile()
Indicates whether Refresh Data when Opening File.
|
DateTime |
getRefreshDate()
Gets the last date time when the PivotTable was refreshed.
|
java.lang.String |
getRefreshedByWho()
Gets the name of the last user who refreshed this PivotTable
|
boolean |
getRepeatItemsOnEachPrintedPage()
Indicates whether pivot item captions on the row area are repeated on each printed page for pivot fields in tabular form.
|
PivotFieldCollection |
getRowFields()
Returns a PivotFields object that are currently shown as row fields.
|
boolean |
getRowGrand()
Deprecated.
Use PivotTable.ShowRowGrandTotals property instead.
|
java.lang.String |
getRowHeaderCaption()
Gets the Row Header Caption of the PivotTable.
|
CellArea |
getRowRange()
Returns a CellArea object that represents the range
that contains the row area in the PivotTable report.
|
boolean |
getSaveData()
Indicates whether data for the PivotTable report is saved with the workbook.
|
boolean |
getShowColumnGrandTotals()
Indicates whether to show grand totals for columns of this pivot table.
|
boolean |
getShowDataTips()
Specifies a boolean value that indicates whether tooltips should be displayed for PivotTable data cells.
|
boolean |
getShowDrill()
Gets whether showing expand/collapse buttons.
|
boolean |
getShowEmptyCol()
Indicates whether to include empty columns in the table
|
boolean |
getShowEmptyRow()
Indicates whether to include empty rows in the table.
|
boolean |
getShowMemberPropertyTips()
Specifies a boolean value that indicates whether member property information should be omitted from PivotTable tooltips.
|
boolean |
getShowPivotStyleColumnHeader()
Indicates whether the column header in the pivot table should have the style applied.
|
boolean |
getShowPivotStyleColumnStripes()
Indicates whether stripe formatting is applied for column.
|
boolean |
getShowPivotStyleLastColumn()
Indicates whether the column formatting is applied.
|
boolean |
getShowPivotStyleRowHeader()
Indicates whether the row header in the pivot table should have the style applied.
|
boolean |
getShowPivotStyleRowStripes()
Indicates whether row stripe formatting is applied.
|
boolean |
getShowRowGrandTotals()
Indicates whether to show grand totals for rows of the pivot table.
|
boolean |
getShowRowHeaderCaption()
Indicates whether row header caption is shown in the PivotTable report
Indicates whether Display field captions and filter drop downs
|
boolean |
getShowValuesRow()
Indicates whether showing values row.
|
java.lang.String[] |
getSource()
Get pivottable's source data.
|
java.lang.String[] |
getSource(boolean isOriginal)
Get pivottable's source data.
|
ExternalConnection[] |
getSourceDataConnections()
Gets the external connection data sources.
|
byte |
getSourceType()
Gets the data source type of the pivot table.
|
boolean |
getSubtotalHiddenPageItems()
Indicates whether hidden page field items in the PivotTable report
are included in row and column subtotals, block totals, and grand totals.
|
CellArea |
getTableRange1()
Returns a CellArea object that represents the range containing the entire PivotTable report,
but doesn't include page fields.
|
CellArea |
getTableRange2()
Returns a CellArea object that represents the range containing the entire PivotTable report,
includes page fields.
|
java.lang.String |
getTag()
Gets a string saved with the PivotTable report.
|
boolean |
hasBlankRows()
Indicates whether to add blank rows.
|
boolean |
isAutoFormat()
Indicates whether the PivotTable report is automatically formatted.
|
boolean |
isExcel2003Compatible()
Specifies whether the PivotTable is compatible for Excel2003 when refreshing PivotTable,
if true, a string must be less than or equal to 255 characters, so if the string is greater than 255 characters,
it will be truncated.
|
boolean |
isGridDropZones()
Indicates whether the PivotTable report displays classic pivottable layout.
|
boolean |
isMultipleFieldFilters()
Deprecated.
Use PivotTable.AllowMultipleFiltersPerField property instead.
|
boolean |
isSelected()
Indicates whether this PivotTable is selected.
|
void |
move(int row,
int column)
Deprecated.
Use PivotTable.MoveTo() method instead.
|
void |
move(java.lang.String destCellName)
Deprecated.
Use PivotTable.MoveTo() method instead.
|
void |
moveTo(int row,
int column)
Moves the PivotTable to a different location in the worksheet.
|
void |
moveTo(java.lang.String destCellName)
Moves the PivotTable to a different location in the worksheet.
|
int |
refreshData()
Refreshes pivottable's data and setting from it's data source.
|
int |
refreshData(PivotTableRefreshOption option)
Refreshes pivottable's data and setting from it's data source with options.
|
void |
removeField(int fieldType,
int baseFieldIndex)
Removes a field from specific field area
|
void |
removeField(int fieldType,
PivotField pivotField)
Remove field from specific field area
|
void |
removeField(int fieldType,
java.lang.String fieldName)
Removes a field from specific field area
|
PivotAreaCollection |
selectArea(CellArea ca)
Select an area of pivot table view.
|
void |
setAllowMultipleFiltersPerField(boolean value)
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
void |
setAltTextDescription(java.lang.String value)
Gets the description of the alt text.
|
void |
setAltTextTitle(java.lang.String value)
Sets the title of the alter text.
|
void |
setAutofitColumnWidthOnUpdate(boolean value)
Indicates whether autofitting column width on update
|
void |
setAutoFormat(boolean value)
Indicates whether the PivotTable report is automatically formatted.
|
void |
setAutoFormatType(int value)
Sets the auto format type of PivotTable.
|
void |
setAutoGroupField(int baseFieldIndex)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setAutoGroupField(PivotField pivotField)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setColumnGrand(boolean value)
Deprecated.
Use PivotTable.ShowColumnGrandTotals property instead.
|
void |
setColumnHeaderCaption(java.lang.String value)
Gets the Column Header Caption of the PivotTable.
|
void |
setCustomListSort(boolean value)
Indicates whether consider built-in custom list when sort data
|
void |
setDataFieldHeaderName(java.lang.String value)
Sets the name of the value area field header in the PivotTable.
|
void |
setDataSource(java.lang.String[] value)
Sets the data source of the pivot table.
|
void |
setDisplayErrorString(boolean value)
Indicates whether the PivotTable report displays a custom string in cells that contain errors.
|
void |
setDisplayImmediateItems(boolean value)
Indicates whether items in the row and column areas are visible
when the data area of the PivotTable is empty.
|
void |
setDisplayNullString(boolean value)
Indicates whether the PivotTable report displays a custom string if the value is null.
|
void |
setEnableDataValueEditing(boolean value)
Specifies a boolean value that indicates whether the user is allowed to edit the cells in the data area of the pivottable.
|
void |
setEnableDrilldown(boolean value)
Gets whether drilldown is enabled.
|
void |
setEnableFieldDialog(boolean value)
Indicates whether the PivotTable Field dialog box is available
when the user double-clicks the PivotTable field.
|
void |
setEnableFieldList(boolean value)
Indicates whether the field list for the PivotTable is available on the view of Excel.
|
void |
setEnableWizard(boolean value)
Indicates whether the PivotTable Wizard is available.
|
void |
setErrorString(java.lang.String value)
Gets the string displayed in cells that contain errors
when the DisplayErrorString property is true.The default value is an empty string.
|
void |
setExcel2003Compatible(boolean value)
Specifies whether the PivotTable is compatible for Excel2003 when refreshing PivotTable,
if true, a string must be less than or equal to 255 characters, so if the string is greater than 255 characters,
it will be truncated.
|
void |
setFieldListSortAscending(boolean value)
Indicates whether fields in the PivotTable are sorted in non-default order in the field list.
|
void |
setGrandTotalName(java.lang.String value)
Returns the label that is displayed in the grand total column or row heading.
|
void |
setGridDropZones(boolean value)
Indicates whether the PivotTable report displays classic pivottable layout.
|
void |
setHasBlankRows(boolean value)
Indicates whether to add blank rows.
|
void |
setIndent(int value)
Specifies the indentation increment for compact axis and can be used to set the Report Layout to Compact Form.
|
void |
setItemPrintTitles(boolean value)
Deprecated.
Use PivotTable.RepeatItemsOnEachPrintedPage property instead.
|
void |
setManualGroupField(int baseFieldIndex,
DateTime startVal,
DateTime endVal,
java.util.ArrayList groupByList,
int intervalNum)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setManualGroupField(int baseFieldIndex,
double startVal,
double endVal,
java.util.ArrayList groupByList,
double intervalNum)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setManualGroupField(PivotField pivotField,
DateTime startVal,
DateTime endVal,
java.util.ArrayList groupByList,
int intervalNum)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setManualGroupField(PivotField pivotField,
double startVal,
double endVal,
java.util.ArrayList groupByList,
double intervalNum)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setManualUpdate(boolean value)
Indicates whether the PivotTable report is recalculated only at the user's request.
|
void |
setMergeLabels(boolean value)
True if the specified PivotTable report's outer-row item, column item, subtotal, and grand total labels use merged cells.
|
void |
setMissingItemsLimit(int value)
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
void |
setMultipleFieldFilters(boolean value)
Deprecated.
Use PivotTable.AllowMultipleFiltersPerField property instead.
|
void |
setName(java.lang.String value)
Gets the name of the PivotTable
|
void |
setNullString(java.lang.String value)
Gets the string displayed in cells that contain null values
when the DisplayNullString property is true.The default value is an empty string.
|
void |
setPageFieldOrder(int value)
Sets the order in which page fields are added to the PivotTable report's layout.
|
void |
setPageFieldWrapCount(int value)
Gets the number of page fields in each column or row in the PivotTable report.
|
void |
setPivotTableStyleName(java.lang.String value)
Sets the pivottable style name.
|
void |
setPivotTableStyleType(int value)
Sets the built-in pivot table style.
|
void |
setPreserveFormatting(boolean value)
Indicates whether formatting is preserved when the PivotTable is refreshed or recalculated.
|
void |
setPrintDrill(boolean value)
Specifies a boolean value that indicates whether drill indicators should be printed.
|
void |
setPrintTitles(boolean value)
Indicates whether the print titles for the worksheet are set based
on the PivotTable report.
|
void |
setRefreshDataFlag(boolean value)
Deprecated.
Simply remove this calling.
|
void |
setRefreshDataOnOpeningFile(boolean value)
Indicates whether Refresh Data when Opening File.
|
void |
setRepeatItemsOnEachPrintedPage(boolean value)
Indicates whether pivot item captions on the row area are repeated on each printed page for pivot fields in tabular form.
|
void |
setRowGrand(boolean value)
Deprecated.
Use PivotTable.ShowRowGrandTotals property instead.
|
void |
setRowHeaderCaption(java.lang.String value)
Gets the Row Header Caption of the PivotTable.
|
void |
setSaveData(boolean value)
Indicates whether data for the PivotTable report is saved with the workbook.
|
void |
setSelected(boolean value)
Indicates whether this PivotTable is selected.
|
void |
setShowColumnGrandTotals(boolean value)
Indicates whether to show grand totals for columns of this pivot table.
|
void |
setShowDataTips(boolean value)
Specifies a boolean value that indicates whether tooltips should be displayed for PivotTable data cells.
|
void |
setShowDrill(boolean value)
Sets whether showing expand/collapse buttons.
|
void |
setShowEmptyCol(boolean value)
Indicates whether to include empty columns in the table
|
void |
setShowEmptyRow(boolean value)
Indicates whether to include empty rows in the table.
|
void |
setShowMemberPropertyTips(boolean value)
Specifies a boolean value that indicates whether member property information should be omitted from PivotTable tooltips.
|
void |
setShowPivotStyleColumnHeader(boolean value)
Indicates whether the column header in the pivot table should have the style applied.
|
void |
setShowPivotStyleColumnStripes(boolean value)
Indicates whether stripe formatting is applied for column.
|
void |
setShowPivotStyleLastColumn(boolean value)
Indicates whether the column formatting is applied.
|
void |
setShowPivotStyleRowHeader(boolean value)
Indicates whether the row header in the pivot table should have the style applied.
|
void |
setShowPivotStyleRowStripes(boolean value)
Indicates whether row stripe formatting is applied.
|
void |
setShowRowGrandTotals(boolean value)
Indicates whether to show grand totals for rows of the pivot table.
|
void |
setShowRowHeaderCaption(boolean value)
Indicates whether row header caption is shown in the PivotTable report
Indicates whether Display field captions and filter drop downs
|
void |
setShowValuesRow(boolean value)
Indicates whether showing values row.
|
void |
setSubtotalHiddenPageItems(boolean value)
Indicates whether hidden page field items in the PivotTable report
are included in row and column subtotals, block totals, and grand totals.
|
void |
setTag(java.lang.String value)
Gets a string saved with the PivotTable report.
|
void |
setUngroup(int baseFieldIndex)
Deprecated.
Use PivotField.Ungroup() method instead.
|
void |
setUngroup(PivotField pivotField)
Deprecated.
Use PivotField.Ungroup() method instead.
|
void |
showDetail(int rowOffset,
int columnOffset,
boolean newSheet,
int destRow,
int destColumn)
Show the detail of one item in the data region to a new Table.
|
void |
showInCompactForm()
Layouts the PivotTable in compact form.
|
void |
showInOutlineForm()
Layouts the PivotTable in outline form.
|
void |
showInTabularForm()
Layouts the PivotTable in tabular form.
|
void |
showReportFilterPage(PivotField pageField)
Show all the report filter pages according to PivotField, the PivotField must be located in the PageFields.
|
void |
showReportFilterPageByIndex(int posIndex)
Show all the report filter pages according to the position index in the PageFields
|
void |
showReportFilterPageByName(java.lang.String fieldName)
Show all the report filter pages according to PivotField's name, the PivotField must be located in the PageFields.
|
public void dispose()
public boolean isExcel2003Compatible()
public void setExcel2003Compatible(boolean value)
public java.lang.String getRefreshedByWho()
public DateTime getRefreshDate()
public java.lang.String getPivotTableStyleName()
public void setPivotTableStyleName(java.lang.String value)
public int getPivotTableStyleType()
See PivotTableStyleType.
public void setPivotTableStyleType(int value)
See PivotTableStyleType.
public void copyStyle(PivotTable pivotTable)
pivotTable - Source pivot table.public void showReportFilterPage(PivotField pageField)
pageField - The PivotField objectpublic void showReportFilterPageByName(java.lang.String fieldName)
fieldName - The name of PivotFieldpublic void showReportFilterPageByIndex(int posIndex)
posIndex - The position index in the PageFieldspublic void removeField(int fieldType,
java.lang.String fieldName)
fieldType - PivotFieldType. The fields area type.fieldName - The name in the base fields.public void removeField(int fieldType,
int baseFieldIndex)
fieldType - PivotFieldType. The fields area type.baseFieldIndex - The field index in the base fields.public void removeField(int fieldType,
PivotField pivotField)
fieldType - PivotFieldType. the fields area type.pivotField - the field in the base fields.public int addFieldToArea(int fieldType,
java.lang.String fieldName)
fieldType - PivotFieldType. The fields area type.fieldName - The name in the base fields.public int addFieldToArea(int fieldType,
int baseFieldIndex)
fieldType - PivotFieldType. The fields area type.baseFieldIndex - The field index in the base fields.public int addFieldToArea(int fieldType,
PivotField pivotField)
fieldType - PivotFieldType. the fields area type.pivotField - the field in the base fields.public void addCalculatedField(java.lang.String name,
java.lang.String formula,
boolean dragToDataArea)
name - The name of the calculated fieldformula - The formula of the calculated field.dragToDataArea - True,drag this field to data area immediatelypublic void addCalculatedField(java.lang.String name,
java.lang.String formula)
name - The name of the calculated fieldformula - The formula of the calculated field.public PivotFieldCollection getFields(int fieldType)
fieldType - PivotFieldType. the region type.public PivotFieldCollection fields(int fieldType)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GetFields() method. This method will be removed 12 months later since May 2024. Aspose apologizes for any inconvenience you may have experienced.fieldType - PivotFieldType. the field type.public PivotFieldCollection getColumnFields()
public PivotFieldCollection getRowFields()
public PivotFieldCollection getPageFields()
public PivotFieldCollection getDataFields()
public PivotField getDataField()
PivotField object that represents all the data fields in a PivotTable.
Read-only.
It would only be created when there are two or more data fields in the Data region.
Defaultly it is in row region. You can drag it to the row/column region with PivotTable.AddFieldToArea() method .public PivotFieldCollection getBaseFields()
public PivotFilterCollection getPivotFilters()
public CellArea getColumnRange()
public CellArea getRowRange()
public CellArea getDataBodyRange()
CellArea object that represents the range that contains the data area
in the list between the header row and the insert row. Read-only.public CellArea getTableRange1()
public CellArea getTableRange2()
public void move(int row,
int column)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.MoveTo() method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.row - row index.column - column index.public void move(java.lang.String destCellName)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.MoveTo() method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.destCellName - the dest cell name.public void moveTo(int row,
int column)
row - row index.column - column index.public void moveTo(java.lang.String destCellName)
destCellName - the dest cell name.public boolean isGridDropZones()
public void setGridDropZones(boolean value)
public boolean getShowColumnGrandTotals()
public void setShowColumnGrandTotals(boolean value)
public boolean getShowRowGrandTotals()
Remarks
public void setShowRowGrandTotals(boolean value)
Remarks
public boolean getColumnGrand()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.ShowColumnGrandTotals method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public void setColumnGrand(boolean value)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.ShowColumnGrandTotals method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public boolean getRowGrand()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.ShowRowGrandTotals method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public void setRowGrand(boolean value)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.ShowRowGrandTotals method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public boolean getDisplayNullString()
public void setDisplayNullString(boolean value)
public java.lang.String getNullString()
public void setNullString(java.lang.String value)
public boolean getDisplayErrorString()
public void setDisplayErrorString(boolean value)
public java.lang.String getDataFieldHeaderName()
public void setDataFieldHeaderName(java.lang.String value)
public java.lang.String getErrorString()
public void setErrorString(java.lang.String value)
public boolean isAutoFormat()
public void setAutoFormat(boolean value)
public boolean getAutofitColumnWidthOnUpdate()
public void setAutofitColumnWidthOnUpdate(boolean value)
public int getAutoFormatType()
public void setAutoFormatType(int value)
public boolean hasBlankRows()
public void setHasBlankRows(boolean value)
public boolean getMergeLabels()
public void setMergeLabels(boolean value)
public boolean getPreserveFormatting()
public void setPreserveFormatting(boolean value)
public boolean getShowDrill()
public void setShowDrill(boolean value)
public boolean getEnableDrilldown()
public void setEnableDrilldown(boolean value)
public boolean getEnableFieldDialog()
public void setEnableFieldDialog(boolean value)
public boolean getEnableFieldList()
public void setEnableFieldList(boolean value)
public boolean getEnableWizard()
public void setEnableWizard(boolean value)
public boolean getSubtotalHiddenPageItems()
public void setSubtotalHiddenPageItems(boolean value)
public java.lang.String getGrandTotalName()
public void setGrandTotalName(java.lang.String value)
public boolean getManualUpdate()
public void setManualUpdate(boolean value)
public boolean isMultipleFieldFilters()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.AllowMultipleFiltersPerField property. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public void setMultipleFieldFilters(boolean value)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.AllowMultipleFiltersPerField property. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public boolean getAllowMultipleFiltersPerField()
public void setAllowMultipleFiltersPerField(boolean value)
public int getMissingItemsLimit()
public void setMissingItemsLimit(int value)
public boolean getEnableDataValueEditing()
public void setEnableDataValueEditing(boolean value)
public boolean getShowDataTips()
public void setShowDataTips(boolean value)
public boolean getShowMemberPropertyTips()
public void setShowMemberPropertyTips(boolean value)
public boolean getShowValuesRow()
public void setShowValuesRow(boolean value)
public boolean getShowEmptyCol()
public void setShowEmptyCol(boolean value)
public boolean getShowEmptyRow()
public void setShowEmptyRow(boolean value)
public boolean getFieldListSortAscending()
public void setFieldListSortAscending(boolean value)
public boolean getPrintDrill()
public void setPrintDrill(boolean value)
public java.lang.String getAltTextTitle()
public void setAltTextTitle(java.lang.String value)
public java.lang.String getAltTextDescription()
public void setAltTextDescription(java.lang.String value)
public java.lang.String getName()
public void setName(java.lang.String value)
public java.lang.String getColumnHeaderCaption()
public void setColumnHeaderCaption(java.lang.String value)
public int getIndent()
public void setIndent(int value)
public java.lang.String getRowHeaderCaption()
public void setRowHeaderCaption(java.lang.String value)
public boolean getShowRowHeaderCaption()
public void setShowRowHeaderCaption(boolean value)
public boolean getCustomListSort()
public void setCustomListSort(boolean value)
public PivotFormatConditionCollection getPivotFormatConditions()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.ConditionalFormats property. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public PivotConditionalFormatCollection getConditionalFormats()
public int getPageFieldOrder()
See PrintOrderType.
public void setPageFieldOrder(int value)
See PrintOrderType.
public int getPageFieldWrapCount()
public void setPageFieldWrapCount(int value)
public java.lang.String getTag()
public void setTag(java.lang.String value)
public boolean getSaveData()
public void setSaveData(boolean value)
public boolean getRefreshDataOnOpeningFile()
public void setRefreshDataOnOpeningFile(boolean value)
public boolean getRefreshDataFlag()
Remarks
NOTE: This method is now obsolete. Instead, This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public void setRefreshDataFlag(boolean value)
Remarks
NOTE: This method is now obsolete. Instead, This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public byte getSourceType()
See PivotTableSourceType.
public ExternalConnection getExternalConnectionDataSource()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.GetSourceDataConnections() method. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.public ExternalConnection[] getSourceDataConnections()
public java.lang.String[] getNamesOfSourceDataConnections()
public java.lang.String[] getDataSource()
public void setDataSource(java.lang.String[] value)
public void changeDataSource(java.lang.String[] source)
public java.lang.String[] getSource()
public java.lang.String[] getSource(boolean isOriginal)
isOriginal - Indicates whether to return original or display data sourcepublic int refreshData()
Remarks
We will gather data from data source to a pivot cache ,then calculate the data in the cache to the cells. This method is only used to gather all data to a pivot cache.public int refreshData(PivotTableRefreshOption option)
option - The options for refreshing data source of pivot table.public void calculateData()
Remarks
Cell.Value in the pivot range could not return the correct result if the method is not been called. This method calculates data with an inner pivot cache,not original data source. So if the data source is changed, please call RefreshData() method first.public void calculateData(PivotTableCalculateOption option)
option - public void clearData()
Remarks
If this method is not called before you add or delete PivotField, Maybe the PivotTable data is not correctedpublic void calculateRange()
Remarks
If this method is not been called,maybe the pivottable range is not corrected.public void formatAll(Style style)
style - Style which is to formatpublic void formatRow(int row,
Style style)
row - Row Index of the Row objectstyle - Style which is to formatpublic void format(PivotArea pivotArea, Style style)
pivotArea - The selected pivot view area.style - The formatted setting.public void format(CellArea ca, Style style)
ca - The range of the cells.style - The stylepublic void format(int row,
int column,
Style style)
row - Row Index of the cellcolumn - Column index of the cellstyle - Style which is to format the cellpublic PivotAreaCollection selectArea(CellArea ca)
ca - The cell area.public void showDetail(int rowOffset,
int columnOffset,
boolean newSheet,
int destRow,
int destColumn)
rowOffset - Offset to the first data row in the data region.columnOffset - Offset to the first data column in the data region.newSheet - Show the detail to a new worksheet.destRow - The target row.destColumn - The target column.public PivotTableFormatCollection getPivotFormats()
public boolean getItemPrintTitles()
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.RepeatItemsOnEachPrintedPage property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.public void setItemPrintTitles(boolean value)
Remarks
NOTE: This property is now obsolete. Instead, please use PivotTable.RepeatItemsOnEachPrintedPage property. This method will be removed 12 months later since October 2024. Aspose apologizes for any inconvenience you may have experienced.public boolean getRepeatItemsOnEachPrintedPage()
public void setRepeatItemsOnEachPrintedPage(boolean value)
public boolean getPrintTitles()
public void setPrintTitles(boolean value)
public boolean getDisplayImmediateItems()
public void setDisplayImmediateItems(boolean value)
public boolean isSelected()
public void setSelected(boolean value)
public boolean getShowPivotStyleRowHeader()
public void setShowPivotStyleRowHeader(boolean value)
public boolean getShowPivotStyleColumnHeader()
public void setShowPivotStyleColumnHeader(boolean value)
public boolean getShowPivotStyleRowStripes()
public void setShowPivotStyleRowStripes(boolean value)
public boolean getShowPivotStyleColumnStripes()
public void setShowPivotStyleColumnStripes(boolean value)
public boolean getShowPivotStyleLastColumn()
public void setShowPivotStyleLastColumn(boolean value)
public void setAutoGroupField(int baseFieldIndex)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.baseFieldIndex - The row or column field index in the base fieldspublic void setAutoGroupField(PivotField pivotField)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.pivotField - The row or column field in the specific fieldspublic void setManualGroupField(int baseFieldIndex,
double startVal,
double endVal,
java.util.ArrayList groupByList,
double intervalNum)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.baseFieldIndex - The row or column field index in the base fieldsstartVal - Specifies the starting value for numeric grouping.endVal - Specifies the ending value for numeric grouping.groupByList - Specifies the grouping type list. Specified by PivotTableGroupTypeintervalNum - Specifies the interval number group by numeric grouping.public void setManualGroupField(PivotField pivotField, double startVal, double endVal, java.util.ArrayList groupByList, double intervalNum)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.pivotField - The row or column field in the base fieldsstartVal - Specifies the starting value for numeric grouping.endVal - Specifies the ending value for numeric grouping.groupByList - Specifies the grouping type list. Specified by PivotTableGroupTypeintervalNum - Specifies the interval number group by numeric grouping.public void setManualGroupField(int baseFieldIndex,
DateTime startVal,
DateTime endVal,
java.util.ArrayList groupByList,
int intervalNum)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.baseFieldIndex - The row or column field index in the base fieldsstartVal - Specifies the starting value for date grouping.endVal - Specifies the ending value for date grouping.groupByList - Specifies the grouping type list. Specified by PivotTableGroupTypeintervalNum - Specifies the interval number group by in days grouping.The number of days must be positive integer of nonzeropublic void setManualGroupField(PivotField pivotField, DateTime startVal, DateTime endVal, java.util.ArrayList groupByList, int intervalNum)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.GroupBy() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.pivotField - The row or column field in the base fieldsstartVal - Specifies the starting value for date grouping.endVal - Specifies the ending value for date grouping.groupByList - Specifies the grouping type list. Specified by PivotTableGroupTypeintervalNum - Specifies the interval number group by in days grouping.The number of days must be positive integer of nonzeropublic void setUngroup(int baseFieldIndex)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.Ungroup() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.baseFieldIndex - The row or column field index in the base fieldspublic void setUngroup(PivotField pivotField)
Remarks
NOTE: This method is now obsolete. Instead, please use PivotField.Ungroup() method. This method will be removed 12 months later since October 2023. Aspose apologizes for any inconvenience you may have experienced.pivotField - The row or column field in the base fieldspublic int[] getHorizontalPageBreaks()
public java.util.ArrayList getHorizontalBreaks()
Remarks
NOTE: This method is now obsolete. Instead, please use PivotTable.GetHorizontalPageBreaks() method. This method will be removed 12 months later since December 2024. Aspose apologizes for any inconvenience you may have experienced.public void showInCompactForm()
public void showInOutlineForm()
public void showInTabularForm()
public Cell getCellByDisplayName(java.lang.String displayName)
Cell object by the display name of PivotField.displayName - the DisplayName of PivotFieldpublic PivotTable[] getChildren()
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.