public class XSSFWorkbook extends POIXMLDocument implements Workbook, java.lang.Iterable<XSSFSheet>
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_CHARACTER_WIDTH
Width of one character of the default font in pixels.
|
static int |
PICTURE_TYPE_BMP |
static int |
PICTURE_TYPE_EPS |
static int |
PICTURE_TYPE_GIF
Images formats supported by XSSF but not by HSSF
|
static int |
PICTURE_TYPE_TIFF |
static int |
PICTURE_TYPE_WPG |
DOCUMENT_CREATOR, OLE_OBJECT_REL_TYPE, PACK_OBJECT_REL_TYPE
DEFAULT_XML_OPTIONS
PICTURE_TYPE_DIB, PICTURE_TYPE_EMF, PICTURE_TYPE_JPEG, PICTURE_TYPE_PICT, PICTURE_TYPE_PNG, PICTURE_TYPE_WMF, SHEET_STATE_HIDDEN, SHEET_STATE_VERY_HIDDEN, SHEET_STATE_VISIBLE
Constructor and Description |
---|
XSSFWorkbook()
Create a new SpreadsheetML workbook.
|
XSSFWorkbook(java.io.InputStream is)
Constructs a XSSFWorkbook object, by buffering the whole stream into memory
and then opening an
OPCPackage object for it. |
XSSFWorkbook(OPCPackage pkg)
Constructs a XSSFWorkbook object given a OpenXML4J
Package object,
see http://poi.apache.org/oxml4j/. |
XSSFWorkbook(java.lang.String path)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultCellStyle(CellStyle cellStyle) |
int |
addDxfCellStyle(DxfCellStyle cellStyle) |
void |
addNamedStyle(NamedStyle cellStyle) |
int |
addPicture(byte[] pictureData,
int format)
Adds a picture to the workbook.
|
int |
addPicture(java.io.InputStream is,
int format)
Adds a picture to the workbook.
|
void |
addTableName(XSSFTable table) |
void |
addTableStyle(TableStyle tbStyle) |
void |
addToolPack(UDFFinder toopack)
Register a new toolpack in this workbook.
|
void |
clearDefaultCellStyles() |
void |
clearDxfCellStyles() |
void |
clearNamedStyles() |
void |
clearTableStyles() |
XSSFSheet |
cloneSheet(int sheetNum)
Create an XSSFSheet from an existing sheet in the XSSFWorkbook.
|
protected void |
commit()
Save the content in the underlying package part.
|
XSSFCellStyle |
createCellStyle()
Create a new XSSFCellStyle and add it to the workbook's style table
|
XSSFDataFormat |
createDataFormat()
Returns the instance of XSSFDataFormat for this workbook.
|
CellStyle |
createDefaultCellStyle(XSSFCellBorder border,
XSSFCellFill fill,
XSSFFont font,
int numFmtId) |
protected XSSFDialogsheet |
createDialogsheet(java.lang.String sheetname,
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDialogsheet dialogsheet) |
DxfCellStyle |
createDxfCellStyle() |
DxfCellStyle |
createDxfCellStyle(int j) |
XSSFFont |
createFont()
Create a new Font and add it to the workbook's font table
|
XSSFName |
createName()
Creates a new (uninitialised) defined name in this workbook
|
NamedStyle |
createNamedStyle(java.lang.String name,
boolean custom,
int builtinId,
int index) |
PivotCache |
createPivotCache(AreaReference sourceRef) |
XSSFSheet |
createSheet()
Create an XSSFSheet for this workbook, adds it to the sheets and returns
the high level representation.
|
XSSFSheet |
createSheet(java.lang.String sheetname)
Create a new sheet for this Workbook and return the high level representation.
|
TableStyle |
createTableStyle(java.lang.String name) |
XSSFFont |
findFont(short boldWeight,
short color,
short fontHeight,
java.lang.String name,
boolean italic,
boolean strikeout,
short typeOffset,
byte underline)
Finds a font that matches the one with the supplied attributes
|
int |
getActiveSheetIndex()
Convenience method to get the active sheet.
|
java.util.List<PackagePart> |
getAllEmbedds()
Get the document's embedded files.
|
java.util.List<XSSFPictureData> |
getAllPictures()
Gets all pictures from the Workbook.
|
XSSFName |
getBuiltInName(java.lang.String builtInCode,
int sheetNumber) |
CalculationChain |
getCalculationChain()
Return the CalculationChain object for this workbook
The calculation chain object specifies the order in which the cells in a workbook were last calculated
|
XSSFCellStyle |
getCellStyleAt(int idx)
Get the cell style object at the given index
|
int |
getCharWidth() |
XSSFCreationHelper |
getCreationHelper()
Returns an object that handles instantiating concrete
classes of the various instances for XSSF.
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCaches |
getCTPivotCaches() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook |
getCTWorkbook()
Return the underlying XML bean
|
java.util.Collection<XSSFMap> |
getCustomXMLMappings() |
java.util.List<CellStyle> |
getDefaultCellStyles() |
java.lang.String |
getDefaultPivotStyle() |
java.lang.String |
getDefaultTableStyle() |
java.util.List<DxfCellStyle> |
getDxfCellStyles() |
int |
getDxfIndex(DxfCellStyle cellStyle) |
int |
getFirstVisibleTab()
Gets the first tab that is displayed in the list of tabs in excel.
|
XSSFFont |
getFontAt(short idx)
Get the font at the given index number
|
boolean |
getForceFormulaRecalculation()
Whether Excel will be asked to recalculate all formulas when the workbook is opened.
|
MapInfo |
getMapInfo() |
Row.MissingCellPolicy |
getMissingCellPolicy()
Retrieves the current policy on what to do when
getting missing or blank cells from a row.
|
XSSFName |
getName(java.lang.String name) |
XSSFName |
getNameAt(int nameIndex) |
java.util.List<NamedStyle> |
getNamedStyles() |
int |
getNameIndex(java.lang.String name)
Gets the named range index by his name
Note:Excel named ranges are case-insensitive and
this method performs a case-insensitive search.
|
short |
getNumberOfFonts()
Get the number of fonts in the this workbook
|
int |
getNumberOfNames()
Get the number of named ranges in the this workbook
|
int |
getNumberOfSheets()
Get the number of worksheets in the this workbook
|
short |
getNumCellStyles()
Get the number of styles the workbook contains
|
java.util.List<PivotCache> |
getPivotCaches() |
java.lang.String |
getPrintArea(int sheetIndex)
Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified.
|
SharedStringsTable |
getSharedStringSource()
Returns SharedStringsTable - tha cache of string for this workbook
|
XSSFSheet |
getSheet(java.lang.String name)
Get sheet with the given name (case insensitive match)
|
XSSFSheet |
getSheetAt(int index)
Get the XSSFSheet object at the given index.
|
int |
getSheetIndex(Sheet sheet)
Returns the index of the given sheet
|
int |
getSheetIndex(java.lang.String name)
Returns the index of the sheet by his name (case insensitive match)
|
java.lang.String |
getSheetName(int sheetIx)
Get the sheet name
|
StylesTable |
getStylesSource()
Return a object representing a collection of shared objects used for styling content,
e.g. fonts, cell styles, colors, etc.
|
XSSFTableName |
getTableName(java.lang.String name) |
java.util.List<TableStyle> |
getTableStyles() |
ThemesTable |
getTheme()
Returns the Theme of current workbook.
|
void |
insertToolPack(int index,
UDFFinder udfFinder)
Inserts the locator of user-defined functions
|
protected boolean |
isDate1904()
Gets a boolean value that indicates whether the date systems used in the workbook starts in 1904.
|
boolean |
isHidden() |
boolean |
isMacroEnabled()
Are we a normal workbook (.xlsx), or a
macro enabled workbook (.xlsm)?
|
boolean |
isRevisionLocked()
Specifies a boolean value that indicates whether the workbook is locked for revisions.
|
boolean |
isSheetHidden(int sheetIx)
Check whether a sheet is hidden.
|
boolean |
isSheetVeryHidden(int sheetIx)
Check whether a sheet is very hidden.
|
boolean |
isStructureLocked()
Specifies a boolean value that indicates whether structure of workbook is locked.
|
boolean |
isWindowsLocked()
Specifies a boolean value that indicates whether the windows that comprise the workbook are locked.
|
java.util.Iterator<XSSFSheet> |
iterator()
Allows foreach loops:
XSSFWorkbook wb = new XSSFWorkbook(package);
for(XSSFSheet sheet : wb){
}
|
void |
lockRevision()
Locks the workbook for revisions.
|
void |
lockStructure()
Locks the structure of workbook.
|
void |
lockWindows()
Locks the windows that comprise the workbook.
|
protected static OPCPackage |
newPackage()
Create a new SpreadsheetML package and setup the default minimal content
|
protected void |
onDeleteFormula(XSSFCell cell)
Fired when a formula is deleted from this workbook,
for example when calling cell.setCellFormula(null)
|
protected void |
onDocumentRead()
Fired when a package part is read
|
void |
removeName(int nameIndex)
Remove the defined name at the specified index
|
void |
removeName(java.lang.String name)
Remove a defined name by name
|
void |
removePrintArea(int sheetIndex)
Delete the printarea for the sheet specified
|
void |
removeSheetAt(int index)
Removes sheet at the given index.
|
void |
removeTableName(java.lang.String tableName) |
void |
renameTableName(java.lang.String oldName,
java.lang.String newName) |
void |
setActiveSheet(int index)
Convenience method to set the active sheet.
|
void |
setDefaultPivotStyle(java.lang.String defaultPivotStyle) |
void |
setDefaultTableStyle(java.lang.String defaultTableStyle) |
void |
setFirstVisibleTab(int index)
Sets the first tab that is displayed in the list of tabs in excel.
|
void |
setForceFormulaRecalculation(boolean value)
Whether the application shall perform a full recalculation when the workbook is opened.
|
void |
setHidden(boolean hiddenFlag) |
void |
setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)
Sets the policy on what to do when
getting missing or blank cells from a row.
|
void |
setPrintArea(int sheetIndex,
int startColumn,
int endColumn,
int startRow,
int endRow)
For the Convenience of Java Programmers maintaining pointers.
|
void |
setPrintArea(int sheetIndex,
java.lang.String reference)
Sets the printarea for the sheet provided
i.e.
|
void |
setRepeatingRowsAndColumns(int sheetIndex,
int startColumn,
int endColumn,
int startRow,
int endRow)
|
void |
setSelectedTab(int index)
We only set one sheet as selected for compatibility with HSSF.
|
void |
setSheetHidden(int sheetIx,
boolean hidden)
Sets the visible state of this sheet.
|
void |
setSheetHidden(int sheetIx,
int state)
Hide or unhide a sheet.
|
void |
setSheetName(int sheetIndex,
java.lang.String sheetname)
Set the sheet name.
|
void |
setSheetOrder(java.lang.String sheetname,
int pos)
sets the order of appearance for a given sheet.
|
void |
unLockRevision()
Unlocks the workbook for revisions.
|
void |
unLockStructure()
Unlocks the structure of workbook.
|
void |
unLockWindows()
Unlocks the windows that comprise the workbook.
|
getCorePart, getPackage, getProperties, getRelatedByType, hasOOXMLHeader, load, openPackage, write
addRelation, clearMemoryPackagePart, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
public static final float DEFAULT_CHARACTER_WIDTH
public static final int PICTURE_TYPE_GIF
public static final int PICTURE_TYPE_TIFF
public static final int PICTURE_TYPE_EPS
public static final int PICTURE_TYPE_BMP
public static final int PICTURE_TYPE_WPG
public XSSFWorkbook()
public XSSFWorkbook(OPCPackage pkg) throws java.io.IOException
Package
object,
see http://poi.apache.org/oxml4j/.
Once you have finished working with the Workbook, you should close the package
by calling pkg.close, to avoid leaving file handles open.
Creating a XSSFWorkbook from a file-backed OPC Package has a lower memory
footprint than an InputStream backed one.pkg
- the OpenXML4J OPC Package
object.java.io.IOException
public XSSFWorkbook(java.io.InputStream is) throws java.io.IOException
OPCPackage
object for it.
Using an InputStream
requires more memory than using a File, so
if a File
is available then you should instead do something like
OPCPackage pkg = OPCPackage.open(path);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
// work with the wb object
......
pkg.close(); // gracefully closes the underlying zip file
java.io.IOException
@Deprecated public XSSFWorkbook(java.lang.String path) throws java.io.IOException
This constructor is deprecated since POI-3.8 because it does not close the underlying .zip file stream. In short, there are two ways to open a OPC package:
It should be noted, that (2) uses quite a bit more memory than (1), which doesn't need to hold the whole zip file in memory, and can take advantage of native methods.
To construct a workbook from file use the
XSSFWorkbook(org.zkoss.poi.openxml4j.opc.OPCPackage)
constructor:
OPCPackage pkg = OPCPackage.open(path);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
// work with the wb object
......
pkg.close(); // gracefully closes the underlying zip file
path
- the file name.java.io.IOException
protected void onDocumentRead() throws java.io.IOException
POIXMLDocumentPart
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCaches getCTPivotCaches()
protected static OPCPackage newPackage()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook getCTWorkbook()
public int addPicture(byte[] pictureData, int format)
addPicture
in interface Workbook
pictureData
- The bytes of the pictureformat
- The format of the picture.getAllPictures()
.Workbook.PICTURE_TYPE_EMF
,
Workbook.PICTURE_TYPE_WMF
,
Workbook.PICTURE_TYPE_PICT
,
Workbook.PICTURE_TYPE_JPEG
,
Workbook.PICTURE_TYPE_PNG
,
Workbook.PICTURE_TYPE_DIB
,
getAllPictures()
public int addPicture(java.io.InputStream is, int format) throws java.io.IOException
is
- The sream to read image fromformat
- The format of the picture.getAllPictures()
.java.io.IOException
Workbook.PICTURE_TYPE_EMF
,
Workbook.PICTURE_TYPE_WMF
,
Workbook.PICTURE_TYPE_PICT
,
Workbook.PICTURE_TYPE_JPEG
,
Workbook.PICTURE_TYPE_PNG
,
Workbook.PICTURE_TYPE_DIB
,
getAllPictures()
public XSSFSheet cloneSheet(int sheetNum)
cloneSheet
in interface Workbook
java.lang.IllegalArgumentException
- if the sheet index in invalidPOIXMLException
- if there were errors when cloningpublic XSSFCellStyle createCellStyle()
createCellStyle
in interface Workbook
public XSSFDataFormat createDataFormat()
createDataFormat
in interface Workbook
DataFormat
public XSSFFont createFont()
createFont
in interface Workbook
public XSSFName createName()
Workbook
createName
in interface Workbook
public XSSFSheet createSheet()
createSheet
in interface Workbook
public XSSFSheet createSheet(java.lang.String sheetname)
Note that Excel allows sheet names up to 31 chars in length but other applications (such as OpenOffice) allow more. Some versions of Excel crash with names longer than 31 chars, others - truncate such names to 31 character.
POI's SpreadsheetAPI silently truncates the input argument to 31 characters. Example:
Sheet sheet = workbook.createSheet("My very long sheet name which is longer than 31 chars"); // will be truncated
assert 31 == sheet.getSheetName().length();
assert "My very long sheet name which i" == sheet.getSheetName();
Except the 31-character constraint, Excel applies some other rules:
Sheet name MUST be unique in the workbook and MUST NOT contain the any of the following characters:
See WorkbookUtil.createSafeSheetName(String nameProposal)
for a safe way to create valid names
createSheet
in interface Workbook
sheetname
- sheetname to set for the sheet.java.lang.IllegalArgumentException
- if the name is null or invalid
or workbook already contains a sheet with this nameWorkbookUtil.createSafeSheetName(String nameProposal)
protected XSSFDialogsheet createDialogsheet(java.lang.String sheetname, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDialogsheet dialogsheet)
public XSSFFont findFont(short boldWeight, short color, short fontHeight, java.lang.String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
public int getActiveSheetIndex()
getActiveSheetIndex
in interface Workbook
public java.util.List<XSSFPictureData> getAllPictures()
getAllPictures
in interface Workbook
XSSFPictureData
objects.)addPicture(byte[], int)
public XSSFCellStyle getCellStyleAt(int idx)
getCellStyleAt
in interface Workbook
idx
- index within the set of stylespublic XSSFFont getFontAt(short idx)
public XSSFName getName(java.lang.String name)
public XSSFName getNameAt(int nameIndex)
public int getNameIndex(java.lang.String name)
getNameIndex
in interface Workbook
name
- named range namepublic short getNumCellStyles()
getNumCellStyles
in interface Workbook
public short getNumberOfFonts()
getNumberOfFonts
in interface Workbook
public int getNumberOfNames()
getNumberOfNames
in interface Workbook
public int getNumberOfSheets()
getNumberOfSheets
in interface Workbook
public java.lang.String getPrintArea(int sheetIndex)
getPrintArea
in interface Workbook
sheetIndex
- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)public XSSFSheet getSheet(java.lang.String name)
public XSSFSheet getSheetAt(int index)
getSheetAt
in interface Workbook
index
- of the sheet number (0-based physical & logical)java.lang.IllegalArgumentException
- if the index is out of range (index
< 0 || index >= getNumberOfSheets()).public int getSheetIndex(java.lang.String name)
getSheetIndex
in interface Workbook
name
- the sheet namepublic int getSheetIndex(Sheet sheet)
getSheetIndex
in interface Workbook
sheet
- the sheet to look uppublic java.lang.String getSheetName(int sheetIx)
getSheetName
in interface Workbook
sheetIx
- Numberpublic java.util.Iterator<XSSFSheet> iterator()
XSSFWorkbook wb = new XSSFWorkbook(package);
for(XSSFSheet sheet : wb){
}
iterator
in interface java.lang.Iterable<XSSFSheet>
public boolean isMacroEnabled()
public void removeName(int nameIndex)
Workbook
removeName
in interface Workbook
nameIndex
- named range index (0 based)public void removeName(java.lang.String name)
Workbook
removeName
in interface Workbook
name
- the name of the defined namepublic void removePrintArea(int sheetIndex)
removePrintArea
in interface Workbook
sheetIndex
- 0-based sheet index (0 = First Sheet)public void removeSheetAt(int index)
removeSheetAt
in interface Workbook
index
- of the sheet (0-based)public Row.MissingCellPolicy getMissingCellPolicy()
Row.MissingCellPolicy
getMissingCellPolicy
in interface Workbook
public void setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)
Row.getCell(int)
}. See
Row.MissingCellPolicy
setMissingCellPolicy
in interface Workbook
public void setActiveSheet(int index)
setActiveSheet
in interface Workbook
index
- index of the active sheet (0-based)public int getFirstVisibleTab()
getFirstVisibleTab
in interface Workbook
public void setFirstVisibleTab(int index)
setFirstVisibleTab
in interface Workbook
index
- integer that contains the index to the active sheet in this book view.public void setPrintArea(int sheetIndex, java.lang.String reference)
i.e. Reference = $A$1:$B$2
setPrintArea
in interface Workbook
sheetIndex
- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)reference
- Valid name Reference for the Print Areapublic void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)
setPrintArea
in interface Workbook
sheetIndex
- Zero-based sheet index (0 = First Sheet)startColumn
- Column to begin printareaendColumn
- Column to end the printareastartRow
- Row to begin the printareaendRow
- Row to end the printareasetPrintArea(int, String)
public void setRepeatingRowsAndColumns(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)
XSSFSheet.setRepeatingRows(CellRangeAddress)
or XSSFSheet.setRepeatingColumns(CellRangeAddress)
workbook.setRepeatingRowsAndColumns(0,0,1,-1,-1);To set just repeating rows:
workbook.setRepeatingRowsAndColumns(0,-1,-1,0,4);To remove all repeating rows and columns for a sheet.
workbook.setRepeatingRowsAndColumns(0,-1,-1,-1,-1);
setRepeatingRowsAndColumns
in interface Workbook
sheetIndex
- 0 based index to sheet.startColumn
- 0 based start of repeating columns.endColumn
- 0 based end of repeating columns.startRow
- 0 based start of repeating rows.endRow
- 0 based end of repeating rows.public XSSFName getBuiltInName(java.lang.String builtInCode, int sheetNumber)
public void setSelectedTab(int index)
setSelectedTab
in interface Workbook
index
- the index of the sheet to select (0 based)Sheet.setSelected(boolean)
public void setSheetName(int sheetIndex, java.lang.String sheetname)
setSheetName
in interface Workbook
sheetIndex
- sheet number (0 based)sheetname
- the new sheet namejava.lang.IllegalArgumentException
- if the name is null or invalid
or workbook already contains a sheet with this namecreateSheet(String)
,
WorkbookUtil.createSafeSheetName(String nameProposal)
public void setSheetOrder(java.lang.String sheetname, int pos)
setSheetOrder
in interface Workbook
sheetname
- the name of the sheet to reorderpos
- the position that we want to insert the sheet into (0 based)protected void commit() throws java.io.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
java.io.IOException
@Internal public SharedStringsTable getSharedStringSource()
public StylesTable getStylesSource()
public ThemesTable getTheme()
public XSSFCreationHelper getCreationHelper()
getCreationHelper
in interface Workbook
protected boolean isDate1904()
The default value is false, meaning that the workbook uses the 1900 date system, where 1/1/1900 is the first day in the system..
public java.util.List<PackagePart> getAllEmbedds() throws OpenXML4JException
getAllEmbedds
in class POIXMLDocument
OpenXML4JException
public boolean isHidden()
public void setHidden(boolean hiddenFlag)
public boolean isSheetHidden(int sheetIx)
Note that a sheet could instead be set to be very hidden, which is different
(isSheetVeryHidden(int)
)
isSheetHidden
in interface Workbook
sheetIx
- Numbertrue
if sheet is hiddenpublic boolean isSheetVeryHidden(int sheetIx)
This is different from the normal hidden status
(isSheetHidden(int)
)
isSheetVeryHidden
in interface Workbook
sheetIx
- sheet index to checktrue
if sheet is very hiddenpublic void setSheetHidden(int sheetIx, boolean hidden)
Calling setSheetHidden(sheetIndex, true)
is equivalent to
setSheetHidden(sheetIndex, Workbook.SHEET_STATE_HIDDEN)
.
Calling setSheetHidden(sheetIndex, false)
is equivalent to
setSheetHidden(sheetIndex, Workbook.SHEET_STATE_VISIBLE)
.
setSheetHidden
in interface Workbook
sheetIx
- the 0-based index of the sheethidden
- whether this sheet is hiddensetSheetHidden(int, int)
public void setSheetHidden(int sheetIx, int state)
setSheetHidden
in interface Workbook
sheetIx
- the sheet index (0-based)state
- one of the following Workbook
constants:
Workbook.SHEET_STATE_VISIBLE
,
Workbook.SHEET_STATE_HIDDEN
, or
Workbook.SHEET_STATE_VERY_HIDDEN
.java.lang.IllegalArgumentException
- if the supplied sheet index or state is invalidprotected void onDeleteFormula(XSSFCell cell)
XSSFCell.setCellFormula(String)
@Internal public CalculationChain getCalculationChain()
The calculation chain object specifies the order in which the cells in a workbook were last calculated
CalculationChain
object or null
if not definedpublic java.util.Collection<XSSFMap> getCustomXMLMappings()
@Internal public MapInfo getMapInfo()
public boolean isStructureLocked()
public boolean isWindowsLocked()
public boolean isRevisionLocked()
public void lockStructure()
public void unLockStructure()
public void lockWindows()
public void unLockWindows()
public void lockRevision()
public void unLockRevision()
public void insertToolPack(int index, UDFFinder udfFinder)
public void addToolPack(UDFFinder toopack)
addToolPack
in interface Workbook
toopack
- the toolpack to registerpublic void setForceFormulaRecalculation(boolean value)
Typically you want to force formula recalculation when you modify cell formulas or values of a workbook previously created by Excel. When set to true, this flag will tell Excel that it needs to recalculate all formulas in the workbook the next time the file is opened.
Note, that recalculation updates cached formula results and, thus, modifies the workbook. Depending on the version, Excel may prompt you with "Do you want to save the changes in filename?" on close.
setForceFormulaRecalculation
in interface Workbook
value
- true if the application will perform a full recalculation of
workbook values when the workbook is openedpublic boolean getForceFormulaRecalculation()
getForceFormulaRecalculation
in interface Workbook
public java.util.List<PivotCache> getPivotCaches()
getPivotCaches
in interface Workbook
public PivotCache createPivotCache(AreaReference sourceRef)
createPivotCache
in interface Workbook
public void clearDefaultCellStyles()
clearDefaultCellStyles
in interface Workbook
public void addDefaultCellStyle(CellStyle cellStyle)
addDefaultCellStyle
in interface Workbook
public java.util.List<CellStyle> getDefaultCellStyles()
getDefaultCellStyles
in interface Workbook
public void clearNamedStyles()
clearNamedStyles
in interface Workbook
public java.util.List<NamedStyle> getNamedStyles()
getNamedStyles
in interface Workbook
public void addNamedStyle(NamedStyle cellStyle)
addNamedStyle
in interface Workbook
public NamedStyle createNamedStyle(java.lang.String name, boolean custom, int builtinId, int index)
createNamedStyle
in interface Workbook
public void clearDxfCellStyles()
clearDxfCellStyles
in interface Workbook
public java.util.List<DxfCellStyle> getDxfCellStyles()
getDxfCellStyles
in interface Workbook
public DxfCellStyle createDxfCellStyle(int j)
public int addDxfCellStyle(DxfCellStyle cellStyle)
addDxfCellStyle
in interface Workbook
public DxfCellStyle createDxfCellStyle()
createDxfCellStyle
in interface Workbook
public CellStyle createDefaultCellStyle(XSSFCellBorder border, XSSFCellFill fill, XSSFFont font, int numFmtId)
public XSSFTableName getTableName(java.lang.String name)
public void addTableName(XSSFTable table)
public void renameTableName(java.lang.String oldName, java.lang.String newName)
public void removeTableName(java.lang.String tableName)
public int getCharWidth()
public void clearTableStyles()
clearTableStyles
in interface Workbook
public java.util.List<TableStyle> getTableStyles()
getTableStyles
in interface Workbook
public java.lang.String getDefaultPivotStyle()
getDefaultPivotStyle
in interface Workbook
public java.lang.String getDefaultTableStyle()
getDefaultTableStyle
in interface Workbook
public int getDxfIndex(DxfCellStyle cellStyle)
getDxfIndex
in interface Workbook
public void addTableStyle(TableStyle tbStyle)
addTableStyle
in interface Workbook
public TableStyle createTableStyle(java.lang.String name)
createTableStyle
in interface Workbook
public void setDefaultPivotStyle(java.lang.String defaultPivotStyle)
setDefaultPivotStyle
in interface Workbook
public void setDefaultTableStyle(java.lang.String defaultTableStyle)
setDefaultTableStyle
in interface Workbook
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.