Package org.apache.poi.xssf.usermodel
Class XSSFPivotTable
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- org.apache.poi.xssf.usermodel.XSSFPivotTable
-
public class XSSFPivotTable extends POIXMLDocumentPart
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColLabel(int columnIndex)
Add a col label using data from the given column.void
addColLabel(int columnIndex, java.lang.String valueFormat)
Add a col label using data from the given column.void
addColumnLabel(DataConsolidateFunction function, int columnIndex)
Add a column label using data from the given column and specified functionvoid
addColumnLabel(DataConsolidateFunction function, int columnIndex, java.lang.String valueFieldName)
Add a column label using data from the given column and specified functionvoid
addColumnLabel(DataConsolidateFunction function, int columnIndex, java.lang.String valueFieldName, java.lang.String valueFormat)
Add a column label using data from the given column and specified functionvoid
addDataColumn(int columnIndex, boolean isDataField)
Add column containing data from the referenced area.void
addReportFilter(int columnIndex)
Add filter for the column with the corresponding index and cell valuevoid
addRowLabel(int columnIndex)
Add a row label using data from the given column.java.util.List<java.lang.Integer>
getColLabelColumns()
CTPivotTableDefinition
getCTPivotTableDefinition()
Sheet
getDataSheet()
Sheet
getParentSheet()
XSSFPivotCache
getPivotCache()
XSSFPivotCacheDefinition
getPivotCacheDefinition()
XSSFPivotCacheRecords
getPivotCacheRecords()
java.util.List<java.lang.Integer>
getRowLabelColumns()
void
readFrom(java.io.InputStream is)
void
setCTPivotTableDefinition(CTPivotTableDefinition pivotTableDefinition)
void
setParentSheet(XSSFSheet parentSheet)
void
setPivotCache(XSSFPivotCache pivotCache)
void
setPivotCacheDefinition(XSSFPivotCacheDefinition pivotCacheDefinition)
void
setPivotCacheRecords(XSSFPivotCacheRecords pivotCacheRecords)
-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, setCommited, toString
-
-
-
-
Method Detail
-
readFrom
@Beta public void readFrom(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
setPivotCache
@Beta public void setPivotCache(XSSFPivotCache pivotCache)
-
getPivotCache
@Beta public XSSFPivotCache getPivotCache()
-
getCTPivotTableDefinition
@Beta @Internal public CTPivotTableDefinition getCTPivotTableDefinition()
-
setCTPivotTableDefinition
@Beta @Internal public void setCTPivotTableDefinition(CTPivotTableDefinition pivotTableDefinition)
-
getPivotCacheDefinition
@Beta public XSSFPivotCacheDefinition getPivotCacheDefinition()
-
setPivotCacheDefinition
@Beta public void setPivotCacheDefinition(XSSFPivotCacheDefinition pivotCacheDefinition)
-
getPivotCacheRecords
@Beta public XSSFPivotCacheRecords getPivotCacheRecords()
-
setPivotCacheRecords
@Beta public void setPivotCacheRecords(XSSFPivotCacheRecords pivotCacheRecords)
-
addRowLabel
@Beta public void addRowLabel(int columnIndex)
Add a row label using data from the given column.- Parameters:
columnIndex
- the index of the source column to be used as row label.columnIndex
is 0-based indexed and relative to the first column in the source.
-
getRowLabelColumns
@Beta public java.util.List<java.lang.Integer> getRowLabelColumns()
-
addColLabel
@Beta public void addColLabel(int columnIndex, java.lang.String valueFormat)
Add a col label using data from the given column.- Parameters:
columnIndex
- the index of the source column to be used as row label.columnIndex
is 0-based indexed and relative to the first column in the source.valueFormat
- format of column value (e.g. for date: "DD.MM.YYYY")
-
addColLabel
@Beta public void addColLabel(int columnIndex)
Add a col label using data from the given column.- Parameters:
columnIndex
- the index of the source column to be used as row label.columnIndex
is 0-based indexed and relative to the first column in the source.
-
getColLabelColumns
@Beta public java.util.List<java.lang.Integer> getColLabelColumns()
-
addColumnLabel
@Beta public void addColumnLabel(DataConsolidateFunction function, int columnIndex, java.lang.String valueFieldName, java.lang.String valueFormat)
Add a column label using data from the given column and specified function- Parameters:
columnIndex
- the index of the source column to be used as column label.columnIndex
is 0-based indexed and relative to the first column in the source.function
- the function to be used on the data The following functions exists: Sum, Count, Average, Max, Min, Product, Count numbers, StdDev, StdDevp, Var, VarpvalueFieldName
- the name of pivot table value fieldvalueFormat
- format of value field (e.g. "#,##0.00")
-
addColumnLabel
@Beta public void addColumnLabel(DataConsolidateFunction function, int columnIndex, java.lang.String valueFieldName)
Add a column label using data from the given column and specified function- Parameters:
columnIndex
- the index of the source column to be used as column label.columnIndex
is 0-based indexed and relative to the first column in the source.function
- the function to be used on the data The following functions exists: Sum, Count, Average, Max, Min, Product, Count numbers, StdDev, StdDevp, Var, VarpvalueFieldName
- the name of pivot table value field
-
addColumnLabel
@Beta public void addColumnLabel(DataConsolidateFunction function, int columnIndex)
Add a column label using data from the given column and specified function- Parameters:
columnIndex
- the index of the source column to be used as column labelcolumnIndex
is 0-based indexed and relative to the first column in the source..function
- the function to be used on the data The following functions exists: Sum, Count, Average, Max, Min, Product, Count numbers, StdDev, StdDevp, Var, Varp
-
addDataColumn
@Beta public void addDataColumn(int columnIndex, boolean isDataField)
Add column containing data from the referenced area.- Parameters:
columnIndex
- the index of the column containing the dataisDataField
- true if the data should be displayed in the pivot table.
-
addReportFilter
@Beta public void addReportFilter(int columnIndex)
Add filter for the column with the corresponding index and cell value- Parameters:
columnIndex
- index of column to filter on
-
-