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, toString
public XSSFPivotTable(PackagePart part, PackageRelationship rel, List<PivotCache> pivotCaches) throws IOException, org.apache.xmlbeans.XmlException
IOException
org.apache.xmlbeans.XmlException
protected void onDocumentCreate()
POIXMLDocumentPart
onDocumentCreate
in class POIXMLDocumentPart
protected 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 POIXMLDocumentPart
IOException
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition getPivotTableDefinition()
public void setPivotCache(PivotCache pivotCache)
public long getCacheId()
PivotTable
getCacheId
in interface PivotTable
public List<PivotField> getColumnFields()
PivotTable
getColumnFields
in interface PivotTable
public void setColumnField(PivotField field)
PivotTable
setColumnField
in interface PivotTable
public void setDataCaption(String caption)
PivotTable
setDataCaption
in interface PivotTable
public String getDataCaption()
PivotTable
getDataCaption
in interface PivotTable
public List<DataField> getDataFields()
PivotTable
getDataFields
in interface PivotTable
public void setDataField(PivotField field, String name, Calculation subtotal)
PivotTable
setDataField
in interface PivotTable
public void setFirstHeaderRow(int row)
PivotTable
setFirstHeaderRow
in interface PivotTable
public 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)
PivotTable
setFirstData
in interface PivotTable
public void setLocationRef(AreaReference ref)
PivotTable
setLocationRef
in interface PivotTable
public AreaReference getLocationRef()
PivotTable
getLocationRef
in interface PivotTable
public CellReference getFirstDataRef()
PivotTable
CellReference
getFirstDataRef
in interface PivotTable
public void setGrandTotalCaption(String caption)
PivotTable
setGrandTotalCaption
in interface PivotTable
public String getGrandTotalCaption()
PivotTable
getGrandTotalCaption
in interface PivotTable
public void setName(String name)
PivotTable
setName
in interface PivotTable
public String getName()
PivotTable
getName
in interface PivotTable
public PivotCache getPivotCache()
PivotTable
PivotCache
of the PivotTable.getPivotCache
in interface PivotTable
public PivotField getPivotField(String name)
PivotTable
PivotField
.getPivotField
in interface PivotTable
public List<PivotField> getPivotFields()
PivotTable
getPivotFields
in interface PivotTable
public List<PivotField> getRowFields()
PivotTable
getRowFields
in interface PivotTable
public Sheet getSheet()
public void setColumnItems(List<List<ItemInfo>> items)
PivotTable
setColumnItems
in interface PivotTable
public void setRowItems(List<List<ItemInfo>> items)
PivotTable
setRowItems
in interface PivotTable
public void setRowField(PivotField field)
PivotTable
setRowField
in interface PivotTable
public void setDataOnRows(boolean dataOnRows)
PivotTable
setDataOnRows
in interface PivotTable
public boolean getDataOnRows()
PivotTable
getDataOnRows
in interface PivotTable
public String getRowHeaderCaption()
PivotTable
getRowHeaderCaption
in interface PivotTable
public void setRowHeaderCaption(String caption)
PivotTable
setRowHeaderCaption
in interface PivotTable
public void setOutline(boolean outline)
setOutline
in interface PivotTable
public boolean getOutline()
getOutline
in interface PivotTable
public void setOutlineData(boolean outlineData)
setOutlineData
in interface PivotTable
public boolean getOutlineData()
getOutlineData
in interface PivotTable
Copyright © 2020. All rights reserved.