public class XSSFPivotTable extends POIXMLDocumentPart implements PivotTable, Serializable
DEFAULT_XML_OPTIONS| Constructor and Description |
|---|
XSSFPivotTable(PackagePart part,
PackageRelationship rel,
List<PivotCache> pivotCaches) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
commit()
Save the content in the underlying package part.
|
long |
getCacheId()
Returns the cache id of the PivotTable.
|
List<PivotField> |
getColumnFields()
Returns all column fields.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColFields |
getCTColFields() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLocation |
getCTLocation() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRowFields |
getCTRowFields() |
String |
getDataCaption()
Returns the data caption.
|
List<DataField> |
getDataFields()
Returns all data fields.
|
boolean |
getDataOnRows()
Returns whether data on rows or not.
|
CellReference |
getFirstDataRef()
Returns the first data
CellReference |
String |
getGrandTotalCaption()
Returns the grand total caption.
|
AreaReference |
getLocationRef()
Returns the location range of the PivotTable.
|
String |
getName()
Returns the name of the PivotTable.
|
boolean |
getOutline() |
boolean |
getOutlineData() |
PivotCache |
getPivotCache()
Returns the
PivotCache of the PivotTable. |
PivotField |
getPivotField(String name)
Returns the
PivotField. |
List<PivotField> |
getPivotFields()
Returns all fields of the PivotTable.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition |
getPivotTableDefinition() |
List<PivotField> |
getRowFields()
Returns all row fields.
|
String |
getRowHeaderCaption()
Returns the row header caption.
|
Sheet |
getSheet() |
protected void |
onDocumentCreate()
Fired when a new package part is created
|
void |
setColumnField(PivotField field)
Sets column type of a pivot field.
|
void |
setColumnItems(List<List<ItemInfo>> items)
Serts column items
|
void |
setDataCaption(String caption)
Sets the data caption.
|
void |
setDataField(PivotField field,
String name,
Calculation subtotal)
Sets data field
|
void |
setDataOnRows(boolean dataOnRows)
Sets data on rows
|
void |
setFirstData(int row,
int col)
Sets the first data row/column index.
|
void |
setFirstHeaderRow(int row)
Sets the first header row.
|
void |
setGrandTotalCaption(String caption)
Sets the grand total caption.
|
void |
setLocationRef(AreaReference ref)
Sets the location range of the PivotTable.
|
void |
setName(String name)
Sets the name of PivotTable.
|
void |
setOutline(boolean outline) |
void |
setOutlineData(boolean outlineData) |
void |
setPivotCache(PivotCache pivotCache) |
void |
setRowField(PivotField field)
Sets row type of a pivot field.
|
void |
setRowHeaderCaption(String caption)
Sets the row header caption.
|
void |
setRowItems(List<List<ItemInfo>> items)
Sets row items.
|
addRelation, clearMemoryPackagePart, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toStringpublic XSSFPivotTable(PackagePart part, PackageRelationship rel, List<PivotCache> pivotCaches) throws IOException, org.apache.xmlbeans.XmlException
IOExceptionorg.apache.xmlbeans.XmlExceptionprotected void onDocumentCreate()
POIXMLDocumentPartonDocumentCreate in class POIXMLDocumentPartprotected void commit()
throws IOException
POIXMLDocumentPart
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
bean.save(out, DEFAULT_XML_OPTIONS);
out.close();
}
commit in class POIXMLDocumentPartIOExceptionpublic org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition getPivotTableDefinition()
public void setPivotCache(PivotCache pivotCache)
public long getCacheId()
PivotTablegetCacheId in interface PivotTablepublic List<PivotField> getColumnFields()
PivotTablegetColumnFields in interface PivotTablepublic void setColumnField(PivotField field)
PivotTablesetColumnField in interface PivotTablepublic void setDataCaption(String caption)
PivotTablesetDataCaption in interface PivotTablepublic String getDataCaption()
PivotTablegetDataCaption in interface PivotTablepublic List<DataField> getDataFields()
PivotTablegetDataFields in interface PivotTablepublic void setDataField(PivotField field, String name, Calculation subtotal)
PivotTablesetDataField in interface PivotTablepublic void setFirstHeaderRow(int row)
PivotTablesetFirstHeaderRow in interface PivotTablepublic org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLocation getCTLocation()
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColFields getCTColFields()
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRowFields getCTRowFields()
public void setFirstData(int row,
int col)
PivotTablesetFirstData in interface PivotTablepublic void setLocationRef(AreaReference ref)
PivotTablesetLocationRef in interface PivotTablepublic AreaReference getLocationRef()
PivotTablegetLocationRef in interface PivotTablepublic CellReference getFirstDataRef()
PivotTableCellReferencegetFirstDataRef in interface PivotTablepublic void setGrandTotalCaption(String caption)
PivotTablesetGrandTotalCaption in interface PivotTablepublic String getGrandTotalCaption()
PivotTablegetGrandTotalCaption in interface PivotTablepublic void setName(String name)
PivotTablesetName in interface PivotTablepublic String getName()
PivotTablegetName in interface PivotTablepublic PivotCache getPivotCache()
PivotTablePivotCache of the PivotTable.getPivotCache in interface PivotTablepublic PivotField getPivotField(String name)
PivotTablePivotField.getPivotField in interface PivotTablepublic List<PivotField> getPivotFields()
PivotTablegetPivotFields in interface PivotTablepublic List<PivotField> getRowFields()
PivotTablegetRowFields in interface PivotTablepublic Sheet getSheet()
public void setColumnItems(List<List<ItemInfo>> items)
PivotTablesetColumnItems in interface PivotTablepublic void setRowItems(List<List<ItemInfo>> items)
PivotTablesetRowItems in interface PivotTablepublic void setRowField(PivotField field)
PivotTablesetRowField in interface PivotTablepublic void setDataOnRows(boolean dataOnRows)
PivotTablesetDataOnRows in interface PivotTablepublic boolean getDataOnRows()
PivotTablegetDataOnRows in interface PivotTablepublic String getRowHeaderCaption()
PivotTablegetRowHeaderCaption in interface PivotTablepublic void setRowHeaderCaption(String caption)
PivotTablesetRowHeaderCaption in interface PivotTablepublic void setOutline(boolean outline)
setOutline in interface PivotTablepublic boolean getOutline()
getOutline in interface PivotTablepublic void setOutlineData(boolean outlineData)
setOutlineData in interface PivotTablepublic boolean getOutlineData()
getOutlineData in interface PivotTableCopyright © 2020. All rights reserved.