Class SXSSFWorkbook
- java.lang.Object
-
- org.apache.poi.xssf.streaming.SXSSFWorkbook
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable, Workbook
public class SXSSFWorkbook extends java.lang.Object implements Workbook
Streaming version of XSSFWorkbook implementing the "BigGridDemo" strategy. SXSSFWorkbook defaults to using inline strings instead of a shared strings table. This is very efficient, since no document content needs to be kept in memory, but is also known to produce documents that are incompatible with some clients. With shared strings enabled all unique strings in the document has to be kept in memory. Depending on your document content this could use a lot more resources than with shared strings disabled. Carefully review your memory budget and compatibility needs before deciding whether to enable shared strings or not.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULT_WINDOW_SIZESpecifies how many rows can be accessed at most via getRow().-
Fields inherited from interface org.apache.poi.ss.usermodel.Workbook
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 Summary
Constructors Constructor and Description SXSSFWorkbook()Construct a new workbookSXSSFWorkbook(int rowAccessWindowSize)Construct an empty workbook and specify the window for row access.SXSSFWorkbook(XSSFWorkbook workbook)Construct a workbook from a template.SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize)Constructs an workbook from an existing workbook.SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles)Constructs an workbook from an existing workbook.SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles, boolean useSharedStringsTable)Constructs an workbook from an existing workbook.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description intaddPicture(byte[] pictureData, int format)Adds a picture to the workbook.voidaddToolPack(UDFFinder toopack)Register a new toolpack in this workbook.SheetcloneSheet(int sheetNum)Create an Sheet from an existing sheet in the Workbook.voidclose()Closes the underlyingXSSFWorkbookandOPCPackageon which this Workbook is based, if any.CellStylecreateCellStyle()Create a new Cell style and add it to the workbook's style tableDataFormatcreateDataFormat()Returns the instance of DataFormat for this workbook.FontcreateFont()Create a new Font and add it to the workbook's font tableNamecreateName()Creates a new (uninitialised) defined name in this workbookSheetcreateSheet()Sreate an Sheet for this Workbook, adds it to the sheets and returns the high level representation.SheetcreateSheet(java.lang.String sheetname)Create an Sheet for this Workbook, adds it to the sheets and returns the high level representation.booleandispose()Dispose of temporary files backing this workbook on disk.FontfindFont(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 attributesintgetActiveSheetIndex()Convenience method to get the active sheet.java.util.List<? extends PictureData>getAllPictures()Gets all pictures from the Workbook.CellStylegetCellStyleAt(short idx)Get the cell style object at the given indexCreationHelpergetCreationHelper()Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF and XSSF.intgetFirstVisibleTab()Gets the first tab that is displayed in the list of tabs in excel.FontgetFontAt(short idx)Get the font at the given index numberbooleangetForceFormulaRecalculation()Whether Excel will be asked to recalculate all formulas when the workbook is opened.Row.MissingCellPolicygetMissingCellPolicy()Retrieves the current policy on what to do when getting missing or blank cells from a row.NamegetName(java.lang.String name)NamegetNameAt(int nameIndex)intgetNameIndex(java.lang.String name)Gets the defined name index by name
Note: Excel defined names are case-insensitive and this method performs a case-insensitive search.shortgetNumberOfFonts()Get the number of fonts in the font tableintgetNumberOfNames()intgetNumberOfSheets()Get the number of spreadsheets in the workbookshortgetNumCellStyles()Get the number of styles the workbook containsjava.lang.StringgetPrintArea(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.intgetRandomAccessWindowSize()SheetgetSheet(java.lang.String name)Get sheet with the given nameSheetgetSheetAt(int index)Get the Sheet object at the given index.intgetSheetIndex(Sheet sheet)Returns the index of the given sheetintgetSheetIndex(java.lang.String name)Returns the index of the sheet by his namejava.lang.StringgetSheetName(int sheet)Set the sheet nameXSSFWorkbookgetXSSFWorkbook()booleanisHidden()booleanisSheetHidden(int sheetIx)Check whether a sheet is hidden.booleanisSheetVeryHidden(int sheetIx)Check whether a sheet is very hidden.intlinkExternalWorkbook(java.lang.String name, Workbook workbook)Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one.voidremoveName(int index)Remove the defined name at the specified indexvoidremoveName(java.lang.String name)Remove a defined name by namevoidremovePrintArea(int sheetIndex)Delete the printarea for the sheet specifiedvoidremoveSheetAt(int index)Removes sheet at the given indexvoidsetActiveSheet(int sheetIndex)Convenience method to set the active sheet.voidsetCompressTempFiles(boolean compress)Set whether temp files should be compressed.voidsetFirstVisibleTab(int sheetIndex)Sets the first tab that is displayed in the list of tabs in excel.voidsetForceFormulaRecalculation(boolean value)Whether the application shall perform a full recalculation when the workbook is opened.voidsetHidden(boolean hiddenFlag)voidsetMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)Sets the policy on what to do when getting missing or blank cells from a row.voidsetPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)For the Convenience of Java Programmers maintaining pointers.voidsetPrintArea(int sheetIndex, java.lang.String reference)Sets the printarea for the sheet providedvoidsetRepeatingRowsAndColumns(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)voidsetSelectedTab(int index)Sets the tab whose data is actually seen when the sheet is opened.voidsetSheetHidden(int sheetIx, boolean hidden)Hide or unhide a sheetvoidsetSheetHidden(int sheetIx, int hidden)Hide or unhide a sheet.voidsetSheetName(int sheet, java.lang.String name)Set the sheet name.voidsetSheetOrder(java.lang.String sheetname, int pos)Sets the order of appearance for a given sheet.voidwrite(java.io.OutputStream stream)Write out this workbook to an Outputstream.
-
-
-
Field Detail
-
DEFAULT_WINDOW_SIZE
public static final int DEFAULT_WINDOW_SIZE
Specifies how many rows can be accessed at most via getRow(). When a new node is created via createRow() and the total number of unflushed records would exeed the specified value, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SXSSFWorkbook
public SXSSFWorkbook()
Construct a new workbook
-
SXSSFWorkbook
public SXSSFWorkbook(XSSFWorkbook workbook)
Construct a workbook from a template.There are three use-cases to use SXSSFWorkbook(XSSFWorkbook) :
- Append new sheets to existing workbooks. You can open existing workbook from a file or create on the fly with XSSF.
- Append rows to existing sheets. The row number MUST be greater than max(rownum) in the template sheet.
- Use existing workbook as a template and re-use global objects such as cell styles, formats, images, etc.
- Access initial cells and rows in the template. After constructing SXSSFWorkbook(XSSFWorkbook) all internal windows are empty and SXSSFSheet@getRow and SXSSFRow#getCell return null.
- Override existing cells and rows. The API silently allows that but the output file is invalid and Excel cannot read it.
- Parameters:
workbook- the template workbook
-
SXSSFWorkbook
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize)
Constructs an workbook from an existing workbook.When a new node is created via createRow() and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore.
A value of -1 indicates unlimited access. In this case all records that have not been flushed by a call to flush() are available for random access.
A value of 0 is not allowed because it would flush any newly created row without having a chance to specify any cells.- Parameters:
rowAccessWindowSize-
-
SXSSFWorkbook
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles)
Constructs an workbook from an existing workbook.When a new node is created via createRow() and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore.
A value of -1 indicates unlimited access. In this case all records that have not been flushed by a call to flush() are available for random access.
A value of 0 is not allowed because it would flush any newly created row without having a chance to specify any cells.- Parameters:
rowAccessWindowSize-compressTmpFiles- whether to use gzip compression for temporary files
-
SXSSFWorkbook
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles, boolean useSharedStringsTable)
Constructs an workbook from an existing workbook.When a new node is created via createRow() and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore.
A value of -1 indicates unlimited access. In this case all records that have not been flushed by a call to flush() are available for random access.
A value of 0 is not allowed because it would flush any newly created row without having a chance to specify any cells.- Parameters:
workbook- the template workbookrowAccessWindowSize-compressTmpFiles- whether to use gzip compression for temporary filesuseSharedStringsTable- whether to use a shared strings table
-
SXSSFWorkbook
public SXSSFWorkbook(int rowAccessWindowSize)
Construct an empty workbook and specify the window for row access.When a new node is created via createRow() and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore.
A value of -1 indicates unlimited access. In this case all records that have not been flushed by a call to flush() are available for random access.
A value of 0 is not allowed because it would flush any newly created row without having a chance to specify any cells.- Parameters:
rowAccessWindowSize-
-
-
Method Detail
-
getRandomAccessWindowSize
public int getRandomAccessWindowSize()
-
setCompressTempFiles
public void setCompressTempFiles(boolean compress)
Set whether temp files should be compressed.SXSSF writes sheet data in temporary files (a temp file per-sheet) and the size of these temp files can grow to to a very large size, e.g. for a 20 MB csv data the size of the temp xml file become few GB large. If the "compress" flag is set to
truethen the temporary XML is gzipped.Please note the the "compress" option may cause performance penalty.
- Parameters:
compress- whether to compress temp files
-
getXSSFWorkbook
public XSSFWorkbook getXSSFWorkbook()
-
getActiveSheetIndex
public int getActiveSheetIndex()
Convenience method to get the active sheet. The active sheet is is the sheet which is currently displayed when the workbook is viewed in Excel. 'Selected' sheet(s) is a distinct concept.- Specified by:
getActiveSheetIndexin interfaceWorkbook- Returns:
- the index of the active sheet (0-based)
-
setActiveSheet
public void setActiveSheet(int sheetIndex)
Convenience method to set the active sheet. The active sheet is is the sheet which is currently displayed when the workbook is viewed in Excel. 'Selected' sheet(s) is a distinct concept.- Specified by:
setActiveSheetin interfaceWorkbook- Parameters:
sheetIndex- index of the active sheet (0-based)
-
getFirstVisibleTab
public int getFirstVisibleTab()
Gets the first tab that is displayed in the list of tabs in excel.- Specified by:
getFirstVisibleTabin interfaceWorkbook- Returns:
- the first tab that to display in the list of tabs (0-based).
-
setFirstVisibleTab
public void setFirstVisibleTab(int sheetIndex)
Sets the first tab that is displayed in the list of tabs in excel.- Specified by:
setFirstVisibleTabin interfaceWorkbook- Parameters:
sheetIndex- the first tab that to display in the list of tabs (0-based)
-
setSheetOrder
public void setSheetOrder(java.lang.String sheetname, int pos)Sets the order of appearance for a given sheet.- Specified by:
setSheetOrderin interfaceWorkbook- Parameters:
sheetname- the name of the sheet to reorderpos- the position that we want to insert the sheet into (0 based)
-
setSelectedTab
public void setSelectedTab(int index)
Sets the tab whose data is actually seen when the sheet is opened. This may be different from the "selected sheet" since excel seems to allow you to show the data of one sheet when another is seen "selected" in the tabs (at the bottom).- Specified by:
setSelectedTabin interfaceWorkbook- Parameters:
index- the index of the sheet to select (0 based)- See Also:
Sheet.setSelected(boolean)
-
setSheetName
public void setSheetName(int sheet, java.lang.String name)Set the sheet name.- Specified by:
setSheetNamein interfaceWorkbook- Parameters:
sheet- number (0 based)- Throws:
java.lang.IllegalArgumentException- if the name is greater than 31 chars or contains/\?*[]- See Also:
Workbook.createSheet(String),WorkbookUtil.createSafeSheetName(String nameProposal)
-
getSheetName
public java.lang.String getSheetName(int sheet)
Set the sheet name- Specified by:
getSheetNamein interfaceWorkbook- Parameters:
sheet- sheet number (0 based)- Returns:
- Sheet name
-
getSheetIndex
public int getSheetIndex(java.lang.String name)
Returns the index of the sheet by his name- Specified by:
getSheetIndexin interfaceWorkbook- Parameters:
name- the sheet name- Returns:
- index of the sheet (0 based)
-
getSheetIndex
public int getSheetIndex(Sheet sheet)
Returns the index of the given sheet- Specified by:
getSheetIndexin interfaceWorkbook- Parameters:
sheet- the sheet to look up- Returns:
- index of the sheet (0 based)
-
createSheet
public Sheet createSheet()
Sreate an Sheet for this Workbook, adds it to the sheets and returns the high level representation. Use this to create new sheets.- Specified by:
createSheetin interfaceWorkbook- Returns:
- Sheet representing the new sheet.
-
createSheet
public Sheet createSheet(java.lang.String sheetname)
Create an Sheet for this Workbook, adds it to the sheets and returns the high level representation. Use this to create new sheets.- Specified by:
createSheetin interfaceWorkbook- Parameters:
sheetname- sheetname to set for the sheet.- Returns:
- Sheet representing the new sheet.
- Throws:
java.lang.IllegalArgumentException- if the name is greater than 31 chars or contains/\?*[]- See Also:
WorkbookUtil.createSafeSheetName(String nameProposal)
-
cloneSheet
public Sheet cloneSheet(int sheetNum)
Create an Sheet from an existing sheet in the Workbook.- Specified by:
cloneSheetin interfaceWorkbook- Returns:
- Sheet representing the cloned sheet.
-
getNumberOfSheets
public int getNumberOfSheets()
Get the number of spreadsheets in the workbook- Specified by:
getNumberOfSheetsin interfaceWorkbook- Returns:
- the number of sheets
-
getSheetAt
public Sheet getSheetAt(int index)
Get the Sheet object at the given index.- Specified by:
getSheetAtin interfaceWorkbook- Parameters:
index- of the sheet number (0-based physical & logical)- Returns:
- Sheet at the provided index
-
getSheet
public Sheet getSheet(java.lang.String name)
Get sheet with the given name
-
removeSheetAt
public void removeSheetAt(int index)
Removes sheet at the given index- Specified by:
removeSheetAtin interfaceWorkbook- Parameters:
index- of the sheet to remove (0-based)
-
setRepeatingRowsAndColumns
@Deprecated public void setRepeatingRowsAndColumns(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)Deprecated. useSXSSFSheet.setRepeatingRows(CellRangeAddress)orSXSSFSheet.setRepeatingColumns(CellRangeAddress)Sets the repeating rows and columns for a sheet (as found in File->PageSetup->Sheet). This is function is included in the workbook because it creates/modifies name records which are stored at the workbook level.To set just repeating columns:
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);
- Specified by:
setRepeatingRowsAndColumnsin interfaceWorkbook- Parameters:
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.
-
createFont
public Font createFont()
Create a new Font and add it to the workbook's font table- Specified by:
createFontin interfaceWorkbook- Returns:
- new font object
-
findFont
public Font 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
-
getNumberOfFonts
public short getNumberOfFonts()
Get the number of fonts in the font table- Specified by:
getNumberOfFontsin interfaceWorkbook- Returns:
- number of fonts
-
getFontAt
public Font getFontAt(short idx)
Get the font at the given index number
-
createCellStyle
public CellStyle createCellStyle()
Create a new Cell style and add it to the workbook's style table- Specified by:
createCellStylein interfaceWorkbook- Returns:
- the new Cell Style object
-
getNumCellStyles
public short getNumCellStyles()
Get the number of styles the workbook contains- Specified by:
getNumCellStylesin interfaceWorkbook- Returns:
- count of cell styles
-
getCellStyleAt
public CellStyle getCellStyleAt(short idx)
Get the cell style object at the given index- Specified by:
getCellStyleAtin interfaceWorkbook- Parameters:
idx- index within the set of styles (0-based)- Returns:
- CellStyle object at the index
-
close
public void close() throws java.io.IOExceptionCloses the underlyingXSSFWorkbookandOPCPackageon which this Workbook is based, if any. Has no effect on Workbooks created from scratch.
-
write
public void write(java.io.OutputStream stream) throws java.io.IOExceptionWrite out this workbook to an Outputstream.
-
dispose
public boolean dispose()
Dispose of temporary files backing this workbook on disk. Calling this method will render the workbook unusable.- Returns:
- true if all temporary files were deleted successfully.
-
getNumberOfNames
public int getNumberOfNames()
- Specified by:
getNumberOfNamesin interfaceWorkbook- Returns:
- the total number of defined names in this workbook
-
getName
public Name getName(java.lang.String name)
-
getNameAt
public Name getNameAt(int nameIndex)
-
createName
public Name createName()
Creates a new (uninitialised) defined name in this workbook- Specified by:
createNamein interfaceWorkbook- Returns:
- new defined name object
-
getNameIndex
public int getNameIndex(java.lang.String name)
Gets the defined name index by name
Note: Excel defined names are case-insensitive and this method performs a case-insensitive search.- Specified by:
getNameIndexin interfaceWorkbook- Parameters:
name- the name of the defined name- Returns:
- zero based index of the defined name. -1 if not found.
-
removeName
public void removeName(int index)
Remove the defined name at the specified index- Specified by:
removeNamein interfaceWorkbook- Parameters:
index- named range index (0 based)
-
removeName
public void removeName(java.lang.String name)
Remove a defined name by name- Specified by:
removeNamein interfaceWorkbook- Parameters:
name- the name of the defined name
-
setPrintArea
public void setPrintArea(int sheetIndex, java.lang.String reference)Sets the printarea for the sheet providedi.e. Reference = $A$1:$B$2
- Specified by:
setPrintAreain interfaceWorkbook- Parameters:
sheetIndex- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)reference- Valid name Reference for the Print Area
-
setPrintArea
public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)For the Convenience of Java Programmers maintaining pointers.- Specified by:
setPrintAreain interfaceWorkbook- Parameters:
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 printarea- See Also:
setPrintArea(int, String)
-
getPrintArea
public 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.- Specified by:
getPrintAreain interfaceWorkbook- Parameters:
sheetIndex- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)- Returns:
- String Null if no print area has been defined
-
removePrintArea
public void removePrintArea(int sheetIndex)
Delete the printarea for the sheet specified- Specified by:
removePrintAreain interfaceWorkbook- Parameters:
sheetIndex- Zero-based sheet index (0 = First Sheet)
-
getMissingCellPolicy
public Row.MissingCellPolicy getMissingCellPolicy()
Retrieves the current policy on what to do when getting missing or blank cells from a row.The default is to return blank and null cells.
Row.MissingCellPolicy- Specified by:
getMissingCellPolicyin interfaceWorkbook
-
setMissingCellPolicy
public void setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)
Sets the policy on what to do when getting missing or blank cells from a row. This will then apply to all calls toRow.getCell(int). SeeRow.MissingCellPolicy- Specified by:
setMissingCellPolicyin interfaceWorkbook
-
createDataFormat
public DataFormat createDataFormat()
Returns the instance of DataFormat for this workbook.- Specified by:
createDataFormatin interfaceWorkbook- Returns:
- the DataFormat object
-
addPicture
public int addPicture(byte[] pictureData, int format)Adds a picture to the workbook.- Specified by:
addPicturein interfaceWorkbook- Parameters:
pictureData- The bytes of the pictureformat- The format of the picture.- Returns:
- the index to this picture (1 based).
- See Also:
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 java.util.List<? extends PictureData> getAllPictures()
Gets all pictures from the Workbook.- Specified by:
getAllPicturesin interfaceWorkbook- Returns:
- the list of pictures (a list of
PictureDataobjects.)
-
getCreationHelper
public CreationHelper getCreationHelper()
Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF and XSSF.- Specified by:
getCreationHelperin interfaceWorkbook
-
isHidden
public boolean isHidden()
-
setHidden
public void setHidden(boolean hiddenFlag)
-
isSheetHidden
public boolean isSheetHidden(int sheetIx)
Check whether a sheet is hidden.Note that a sheet could instead be set to be very hidden, which is different (
isSheetVeryHidden(int))- Specified by:
isSheetHiddenin interfaceWorkbook- Parameters:
sheetIx- Number- Returns:
trueif sheet is hidden
-
isSheetVeryHidden
public boolean isSheetVeryHidden(int sheetIx)
Check whether a sheet is very hidden.This is different from the normal hidden status (
isSheetHidden(int))- Specified by:
isSheetVeryHiddenin interfaceWorkbook- Parameters:
sheetIx- sheet index to check- Returns:
trueif sheet is very hidden
-
setSheetHidden
public void setSheetHidden(int sheetIx, boolean hidden)Hide or unhide a sheet- Specified by:
setSheetHiddenin interfaceWorkbook- Parameters:
sheetIx- the sheet index (0-based)hidden- True to mark the sheet as hidden, false otherwise
-
setSheetHidden
public void setSheetHidden(int sheetIx, int hidden)Hide or unhide a sheet.- 0 - visible.
- 1 - hidden.
- 2 - very hidden.
- Specified by:
setSheetHiddenin interfaceWorkbook- Parameters:
sheetIx- the sheet index (0-based)hidden- one of the followingWorkbookconstants:Workbook.SHEET_STATE_VISIBLE,Workbook.SHEET_STATE_HIDDEN, orWorkbook.SHEET_STATE_VERY_HIDDEN.- Throws:
java.lang.IllegalArgumentException- if the supplied sheet index or state is invalid
-
linkExternalWorkbook
public int linkExternalWorkbook(java.lang.String name, Workbook workbook)Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one. Allows formulas such as "[MyOtherWorkbook]Sheet3!$A$5" to be added to the file, for workbooks not already referenced.- Specified by:
linkExternalWorkbookin interfaceWorkbook- Parameters:
name- The name the workbook will be referenced as in formulasworkbook- The open workbook to fetch the link required information from
-
addToolPack
public void addToolPack(UDFFinder toopack)
Register a new toolpack in this workbook.- Specified by:
addToolPackin interfaceWorkbook- Parameters:
toopack- the toolpack to register
-
setForceFormulaRecalculation
public void setForceFormulaRecalculation(boolean value)
Whether the application shall perform a full recalculation when the workbook is opened.Typically you want to force formula recalculation when you modify cell formulas or values of a workbook previously created by Excel. When set to 0, this flag will tell Excel that it needs to recalculate all formulas in the workbook the next time the file is opened.
- Specified by:
setForceFormulaRecalculationin interfaceWorkbook- Parameters:
value- true if the application will perform a full recalculation of workbook values when the workbook is opened- Since:
- 3.8
-
getForceFormulaRecalculation
public boolean getForceFormulaRecalculation()
Whether Excel will be asked to recalculate all formulas when the workbook is opened.- Specified by:
getForceFormulaRecalculationin interfaceWorkbook
-
-
DataMelt 3.0 © DataMelt by jWork.ORG