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 |
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)
Gets the specific fields by the field type.
|
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
|
java.lang.String |
getAltTextDescription()
Gets the description of the alt text
|
java.lang.String |
getAltTextTitle()
Gets the title of the altertext
|
boolean |
getAutofitColumnWidthOnUpdate()
Indicates whether autofitting column width on update
|
int |
getAutoFormatType()
Gets the PivotTable auto format type.
|
PivotFieldCollection |
getBaseFields()
Returns a PivotFields object that includes all fields in the PivotTable report
|
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()
Indicates whether the PivotTable report shows grand totals for columns.
|
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.
|
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
in cells that contain null values.
|
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()
Gets whether enable the field list for the PivotTable.
|
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()
Gets the external connection data source.
|
boolean |
getFieldListSortAscending()
Specifies a boolean value that indicates whether fields in the PivotTable are sorted in non-default order in the field list.
|
java.lang.String |
getGrandTotalName()
Returns the text string label that is displayed in the grand total column or row heading.
|
java.util.ArrayList |
getHorizontalBreaks()
get pivot table row index list of horizontal pagebreaks
|
int |
getIndent()
Specifies the indentation increment for compact axis and can be used to set the Report Layout to Compact Form.
|
boolean |
getItemPrintTitles()
A bit that specifies whether pivot item captions on the row axis
are repeated on each printed page for pivot fields in tabular form.
|
boolean |
getManualUpdate()
Indicates whether the PivotTable report is recalculated only at the user's request.
|
boolean |
getMergeLabels()
Indicates whether 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 |
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 a PivotFilterCollection object.
|
PivotFormatConditionCollection |
getPivotFormatConditions()
Gets the Format Conditions of the pivot table.
|
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()
Indicates whether Refreshing Data or not.
|
boolean |
getRefreshDataOnOpeningFile()
Indicates whether Refresh Data when Opening File.
|
DateTime |
getRefreshDate()
Gets the date when the PivotTable was last refreshed.
|
java.lang.String |
getRefreshedByWho()
Gets the name of the user who last refreshed the PivotTable
|
PivotFieldCollection |
getRowFields()
Returns a PivotFields object that are currently shown as row fields.
|
boolean |
getRowGrand()
Indicates whether the PivotTable report shows grand totals for rows.
|
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 |
getShowDataTips()
Specifies a boolean value that indicates whether tooltips should be displayed for PivotTable data cells.
|
boolean |
getShowDrill()
Gets whether expand/collapse buttons is shown.
|
boolean |
getShowEmptyCol()
Specifies a boolean value that indicates whether to include empty columns in the table
|
boolean |
getShowEmptyRow()
Specifies a boolean value that 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 column stripe formatting is applied.
|
boolean |
getShowPivotStyleLastColumn()
Indicates whether column stripe 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 |
getShowRowHeaderCaption()
Indicates whether row header caption is shown in the PivotTable report
Indicates whether Display field captions and filter drop downs
|
boolean |
getShowValuesRow()
Specifies a boolean value that indicates whether show values row.
|
java.lang.String[] |
getSource()
Get pivottable's source data.
|
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()
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
boolean |
isSelected()
Indicates whether the PivotTable is selected.
|
void |
move(int row,
int column)
Moves the PivotTable to a different location in the worksheet.
|
void |
move(java.lang.String destCellName)
Moves the PivotTable to a different location in the worksheet.
|
void |
refreshData()
Refreshes pivottable's data and setting from it's data source.
|
void |
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
|
void |
setAltTextDescription(java.lang.String value)
Gets the description of the alt text
|
void |
setAltTextTitle(java.lang.String value)
Gets the title of the altertext
|
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)
Gets the PivotTable auto format type.
|
void |
setAutoGroupField(int baseFieldIndex)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setAutoGroupField(PivotField pivotField)
Deprecated.
Use PivotField.GroupBy() method instead.
|
void |
setColumnGrand(boolean value)
Indicates whether the PivotTable report shows grand totals for columns.
|
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
in cells that contain null values.
|
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)
Gets whether enable the field list for the PivotTable.
|
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)
Specifies a boolean value that indicates whether fields in the PivotTable are sorted in non-default order in the field list.
|
void |
setGrandTotalName(java.lang.String value)
Returns the text string 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)
A bit that specifies whether pivot item captions on the row axis
are repeated on each printed page for pivot fields in tabular form.
|
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)
Indicates whether 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)
Specifies a boolean value that indicates whether the fields of a PivotTable can have multiple filters set on them.
|
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)
Gets 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)
Indicates whether Refreshing Data or not.
|
void |
setRefreshDataOnOpeningFile(boolean value)
Indicates whether Refresh Data when Opening File.
|
void |
setRowGrand(boolean value)
Indicates whether the PivotTable report shows grand totals for rows.
|
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 the PivotTable is selected.
|
void |
setShowDataTips(boolean value)
Specifies a boolean value that indicates whether tooltips should be displayed for PivotTable data cells.
|
void |
setShowDrill(boolean value)
Gets whether expand/collapse buttons is shown.
|
void |
setShowEmptyCol(boolean value)
Specifies a boolean value that indicates whether to include empty columns in the table
|
void |
setShowEmptyRow(boolean value)
Specifies a boolean value that 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 column stripe formatting is applied.
|
void |
setShowPivotStyleLastColumn(boolean value)
Indicates whether column stripe 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 |
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)
Specifies a boolean value that indicates whether show 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 |
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 fields(int fieldType)
fieldType - PivotFieldType. the field type.public PivotFieldCollection getColumnFields()
public PivotFieldCollection getRowFields()
public PivotFieldCollection getPageFields()
public PivotFieldCollection getDataFields()
public PivotField getDataField()
public PivotFieldCollection getBaseFields()
public PivotFilterCollection getPivotFilters()
public CellArea getColumnRange()
public CellArea getRowRange()
public CellArea getDataBodyRange()
public CellArea getTableRange1()
public CellArea getTableRange2()
public void move(int row,
int column)
row - row index.column - column index.public void move(java.lang.String destCellName)
destCellName - the dest cell name.public boolean getColumnGrand()
public void setColumnGrand(boolean value)
public boolean isGridDropZones()
public void setGridDropZones(boolean value)
public boolean getRowGrand()
public void setRowGrand(boolean value)
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()
public void setMultipleFieldFilters(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()
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()
public void setRefreshDataFlag(boolean value)
public ExternalConnection getExternalConnectionDataSource()
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 void 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 void 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 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 - style - public PivotTableFormatCollection getPivotFormats()
public 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 boolean getItemPrintTitles()
public void setItemPrintTitles(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
The row or column field index in the base fields 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.public 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 java.util.ArrayList getHorizontalBreaks()
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 2001-2023. All Rights Reserved.