public class XSSFPivotCacheDefinition extends POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
Modifier | Constructor and Description |
---|---|
|
XSSFPivotCacheDefinition() |
protected |
XSSFPivotCacheDefinition(PackagePart part)
Creates an XSSFPivotCacheDefintion representing the given package part and relationship.
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Save the content in the underlying package part.
|
protected void |
createCacheFields(Sheet sheet)
Generates a cache field for each column in the reference area for the pivot table.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCacheDefinition |
getCTPivotCacheDefinition() |
AreaReference |
getPivotArea(Workbook wb)
Find the 2D base data area for the pivot table, either from its direct reference or named table/range.
|
void |
readFrom(java.io.InputStream is) |
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
@Beta public XSSFPivotCacheDefinition()
@Beta protected XSSFPivotCacheDefinition(PackagePart part) throws java.io.IOException
part
- - The package part that holds xml data representing this pivot cache definition.java.io.IOException
@Beta public void readFrom(java.io.InputStream is) throws java.io.IOException
java.io.IOException
@Beta @Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCacheDefinition getCTPivotCacheDefinition()
@Beta protected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); try (OutputStream out = part.getOutputStream()) { XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); } }
commit
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed@Beta public AreaReference getPivotArea(Workbook wb) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the ref attribute is not contiguous or the name attribute is not found.Copyright 2022 The Apache Software Foundation or its licensors, as applicable.