public class SXSSFWorkbook extends java.lang.Object implements Workbook
Modifier and Type | Class and Description |
---|---|
protected static interface |
SXSSFWorkbook.ISheetInjector |
protected class |
SXSSFWorkbook.SheetIterator<T extends Sheet> |
Modifier and Type | Field and Description |
---|---|
protected SharedStringsTable |
_sharedStringSource
shared string table - a cache of strings in this workbook
(共享字符串表 - 此工作簿中的字符串缓存)
|
protected XSSFWorkbook |
_wb |
static int |
DEFAULT_WINDOW_SIZE
Specifies how many rows can be accessed at most via
SXSSFSheet.getRow(int) .
(指定通过 SXSSFSheet.getRow(int) 最多可以访问多少行。)
|
protected org.apache.commons.compress.archivers.zip.Zip64Mode |
zip64Mode
controls whether Zip64 mode is used - Always became the default in POI 5.0.0
(控制是否使用 Zip64 模式 - 在 POI 5.0.0 中始终成为默认模式)
|
PICTURE_TYPE_DIB, PICTURE_TYPE_EMF, PICTURE_TYPE_JPEG, PICTURE_TYPE_PICT, PICTURE_TYPE_PNG, PICTURE_TYPE_WMF
Constructor and Description |
---|
SXSSFWorkbook()
Construct a new workbook with default row window size
|
SXSSFWorkbook(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.
|
Modifier and Type | Method and Description |
---|---|
int |
addOlePackage(byte[] oleData, java.lang.String label, java.lang.String fileName, java.lang.String command)
Adds an OLE package manager object with the given content to the sheet
(将具有给定内容的 OLE 包管理器对象添加到工作表)
|
int |
addPicture(byte[] pictureData, int format)
Adds a picture to the workbook.
(将图片添加到工作簿。)
|
void |
addToolPack(UDFFinder toopack)
Register a new toolpack in this workbook.
(在此工作簿中注册一个新的工具包。)
|
Sheet |
cloneSheet(int sheetNum)
Not implemented for SXSSFWorkbook Create a Sheet from an existing sheet in the Workbook.
(不适用于 SXSSFWorkbook 从工作簿中的现有工作表创建工作表。)
|
void |
close()
Closes the underlying
XSSFWorkbook and
OPCPackage on which this Workbook is based, if any.
(关闭此工作簿所基于的基础 XSSFWorkbook 和 OPCPackage(如果有)。)
|
protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream |
createArchiveOutputStream(java.io.OutputStream out) |
CellStyle |
createCellStyle()
Create a new Cell style and add it to the workbook's style table
(创建一个新的单元格样式并将其添加到工作簿的样式表中)
|
DataFormat |
createDataFormat()
Returns the instance of DataFormat for this workbook.
(返回此工作簿的 DataFormat 实例。)
|
EvaluationWorkbook |
createEvaluationWorkbook() |
Font |
createFont()
Create a new Font and add it to the workbook's font table
(创建一个新字体并将其添加到工作簿的字体表中)
|
Name |
createName()
Creates a new (uninitialised) defined name in this workbook
(在此工作簿中创建一个新的(未初始化的)定义名称)
|
SXSSFSheet |
createSheet()
Create a Sheet for this Workbook, adds it to the sheets and returns the high level representation.
(为此工作簿创建一个工作表,将其添加到工作表并返回高级表示。)
|
SXSSFSheet |
createSheet(java.lang.String sheetname)
Create a Sheet for this Workbook, adds it to the sheets and returns the high level representation.
(为此工作簿创建一个工作表,将其添加到工作表并返回高级表示。)
|
protected SheetDataWriter |
createSheetDataWriter() |
protected SXSSFWorkbook.ISheetInjector |
createSheetInjector(SXSSFSheet sxSheet) |
boolean |
dispose()
Dispose of temporary files backing this workbook on disk.
(处理磁盘上支持此工作簿的临时文件。)
|
Font |
findFont(boolean bold, 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
(查找与提供的属性匹配的字体)
|
protected void |
flushSheets() |
int |
getActiveSheetIndex()
Convenience method to get the active sheet.
(获取活动工作表的便捷方法。)
|
java.util.List<? extends Name> |
getAllNames()
Returns all defined names
(返回所有定义的名称)
|
java.util.List<? extends PictureData> |
getAllPictures()
Gets all pictures from the Workbook.
(获取工作簿中的所有图片。)
|
CellStyle |
getCellStyleAt(int idx)
Get the cell style object at the given index
(获取给定索引处的单元格样式对象)
|
CreationHelper |
getCreationHelper()
Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF, XSSF and SXSSF.
(返回一个对象,该对象处理实例化 HSSF、XSSF 和 SXSSF 所需的各种实例的具体类。)
|
int |
getFirstVisibleTab()
Gets the first tab that is displayed in the list of tabs in excel.
(获取在 excel 选项卡列表中显示的第一个选项卡。)
|
Font |
getFontAt(int 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.
(打开工作簿时是否会要求 Excel 重新计算所有公式。)
|
Row.MissingCellPolicy |
getMissingCellPolicy()
Retrieves the current policy on what to do when getting missing or blank cells from a row.
(检索有关在一行中缺少单元格或空白单元格时要执行的操作的当前策略。)
|
Name |
getName(java.lang.String name) |
java.util.List<? extends Name> |
getNames(java.lang.String name)
Returns all defined names with the given name.
(返回具有给定名称的所有已定义名称。)
|
int |
getNumberOfFonts()
Get the number of fonts in the font table
(获取字体表中的字体数量)
|
int |
getNumberOfFontsAsInt()
Deprecated.
(已弃用。)
|
int |
getNumberOfNames() |
int |
getNumberOfSheets()
Get the number of spreadsheets in the workbook
(获取工作簿中电子表格的数量)
|
int |
getNumCellStyles()
Get the number of styles the workbook contains
(获取工作簿包含的样式数)
|
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.
(检索指定工作表的打印区域的引用,即使未指定工作表名称,也会将其附加到引用中。)
|
int |
getRandomAccessWindowSize()
See the constructors for a more detailed description of the sliding window of rows.
(有关行的滑动窗口的更详细描述,请参见构造函数。)
|
protected SharedStringsTable |
getSharedStringSource() |
SXSSFSheet |
getSheet(java.lang.String name)
Get sheet with the given name
(获取具有给定名称的工作表)
|
SXSSFSheet |
getSheetAt(int index)
Get the Sheet object at the given index.
(获取给定索引处的 Sheet 对象。)
|
protected XSSFSheet |
getSheetFromZipEntryName(java.lang.String sheetRef) |
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
(按他的名字返回工作表的索引)
|
java.lang.String |
getSheetName(int sheet)
Set the sheet name
(设置工作表名称)
|
SheetVisibility |
getSheetVisibility(int sheetIx)
Get the visibility (visible, hidden, very hidden) of a sheet in this workbook
(获取此工作簿中工作表的可见性(可见、隐藏、非常隐藏))
|
SpreadsheetVersion |
getSpreadsheetVersion()
Returns the spreadsheet version (EXCLE2007) of this workbook
(返回此工作簿的电子表格版本 (EXCLE2007))
|
XSSFWorkbook |
getXSSFWorkbook() |
protected void |
injectData(ZipEntrySource zipEntrySource, java.io.OutputStream out) |
boolean |
isCompressTempFiles()
Get whether temp files should be compressed.
(获取是否应压缩临时文件。)
|
protected boolean |
isDate1904() |
boolean |
isHidden() |
boolean |
isSheetHidden(int sheetIx)
Check whether a sheet is hidden.
(检查工作表是否隐藏。)
|
boolean |
isSheetVeryHidden(int sheetIx)
Check whether a sheet is very hidden.
(检查工作表是否非常隐藏。)
|
java.util.Iterator<Sheet> |
iterator()
Alias for
sheetIterator() to allow foreach loops
(sheetIterator() 的别名以允许 foreach 循环)
|
int |
linkExternalWorkbook(java.lang.String name, Workbook workbook)
Not implemented for SXSSFWorkbook Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one.
(未针对 SXSSFWorkbook 添加 LinkTable 记录以允许将引用指定外部工作簿的公式添加到此记录。)
|
void |
removeName(Name name)
Remove the given defined name
(删除给定的定义名称)
|
void |
removePrintArea(int sheetIndex)
Delete the printarea for the sheet specified
(删除指定工作表的打印区域)
|
void |
removeSheetAt(int index)
Removes sheet at the given index
(删除给定索引处的工作表)
|
void |
setActiveSheet(int sheetIndex)
Convenience method to set the active sheet.
(设置活动工作表的便捷方法。)
|
void |
setCompressTempFiles(boolean compress)
Set whether temp files should be compressed.
(设置是否应压缩临时文件。)
|
void |
setFirstVisibleTab(int sheetIndex)
Sets the first tab that is displayed in the list of tabs in excel.
(设置在 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.
(为了方便 Java 程序员维护指针。)
|
void |
setPrintArea(int sheetIndex, java.lang.String reference)
Sets the printarea for the sheet provided
(设置提供的工作表的打印区域)
|
protected void |
setRandomAccessWindowSize(int rowAccessWindowSize) |
void |
setSelectedTab(int index)
Sets the tab whose data is actually seen when the sheet is opened.
(设置打开工作表时实际看到其数据的选项卡。)
|
void |
setSheetHidden(int sheetIx, boolean hidden)
Hide or unhide a sheet.
(隐藏或取消隐藏工作表。)
|
void |
setSheetName(int sheet, java.lang.String name)
Set the sheet name.
(设置工作表名称。)
|
void |
setSheetOrder(java.lang.String sheetname, int pos)
Sets the order of appearance for a given sheet.
(设置给定工作表的出现顺序。)
|
void |
setSheetVisibility(int sheetIx, SheetVisibility visibility)
Hide or unhide a sheet.
(隐藏或取消隐藏工作表。)
|
void |
setZip64Mode(org.apache.commons.compress.archivers.zip.Zip64Mode zip64Mode) |
java.util.Iterator<Sheet> |
sheetIterator()
Returns an iterator of the sheets in the workbook in sheet order.
(按工作表顺序返回工作簿中工作表的迭代器。)
|
void |
write(java.io.OutputStream stream)
Write out this workbook to an OutputStream.
(将此工作簿写入 OutputStream。)
|
public static final int DEFAULT_WINDOW_SIZE
SXSSFSheet.getRow(int)
. When a new node is created via
SXSSFSheet.createRow(int)
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
SXSSFSheet.getRow(int)
anymore.
(指定通过 SXSSFSheet.getRow(int) 最多可以访问多少行。当通过 SXSSFSheet.createRow(int) 创建新节点并且未刷新的记录总数超过指定值时,索引值最低的行将被刷新,并且无法再通过 SXSSFSheet.getRow(int) 访问。)
protected final XSSFWorkbook _wb
protected final SharedStringsTable _sharedStringSource
protected org.apache.commons.compress.archivers.zip.Zip64Mode zip64Mode
public SXSSFWorkbook()
public SXSSFWorkbook(XSSFWorkbook workbook)
Construct a workbook from a template.
There are three use-cases to use SXSSFWorkbook(XSSFWorkbook) :max(rownum)
in the template sheet. SXSSFSheet.getRow(int)
and SXSSFRow.getCell(int)
return null
. workbook
- the template workbook
(工作簿 - 模板工作簿)
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize)
When a new node is created via SXSSFSheet.createRow(int)
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 SXSSFSheet.getRow(int)
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.
rowAccessWindowSize
- the number of rows that are kept in memory until flushed out, see above.
(rowAccessWindowSize - 在内存中保留的行数,直到被清除,见上文。)
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles)
When a new node is created via SXSSFSheet.createRow(int)
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 SXSSFSheet.getRow(int)
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.
rowAccessWindowSize
- the number of rows that are kept in memory until flushed out, see above.
(rowAccessWindowSize - 在内存中保留的行数,直到被清除,见上文。)
compressTmpFiles
- whether to use gzip compression for temporary files
(compressTmpFiles - 是否对临时文件使用 gzip 压缩)
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles, boolean useSharedStringsTable)
When a new node is created via SXSSFSheet.createRow(int)
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 SXSSFSheet.getRow(int)
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.
workbook
- the template workbook
(工作簿 - 模板工作簿)
rowAccessWindowSize
- the number of rows that are kept in memory until flushed out, see above.
(rowAccessWindowSize - 在内存中保留的行数,直到被清除,见上文。)
compressTmpFiles
- whether to use gzip compression for temporary files
(compressTmpFiles - 是否对临时文件使用 gzip 压缩)
useSharedStringsTable
- whether to use a shared strings table
(useSharedStringsTable - 是否使用共享字符串表)
public SXSSFWorkbook(int rowAccessWindowSize)
When a new node is created via SXSSFSheet.createRow(int)
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 SXSSFSheet.getRow(int)
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.
rowAccessWindowSize
- the number of rows that are kept in memory until flushed out, see above.
(rowAccessWindowSize - 在内存中保留的行数,直到被清除,见上文。)
public int getRandomAccessWindowSize()
protected void setRandomAccessWindowSize(int rowAccessWindowSize)
@Beta public void setZip64Mode(org.apache.commons.compress.archivers.zip.Zip64Mode zip64Mode)
zip64Mode
-
Zip64Mode
(zip64Mode - Zip64Mode)
public boolean isCompressTempFiles()
public void setCompressTempFiles(boolean compress)
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 true
then the temporary XML is gzipped.
Please note the the "compress" option may cause performance penalty.
Setting this option only affects compression for subsequent createSheet()
calls.
compress
- whether to compress temp files
(compress - 是否压缩临时文件)
@Internal protected SharedStringsTable getSharedStringSource()
protected SheetDataWriter createSheetDataWriter() throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected XSSFSheet getSheetFromZipEntryName(java.lang.String sheetRef)
protected void injectData(ZipEntrySource zipEntrySource, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream createArchiveOutputStream(java.io.OutputStream out)
protected SXSSFWorkbook.ISheetInjector createSheetInjector(SXSSFSheet sxSheet) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public XSSFWorkbook getXSSFWorkbook()
public int getActiveSheetIndex()
getActiveSheetIndex
in interface
Workbook
(接口 Workbook 中的 getActiveSheetIndex)
public void setActiveSheet(int sheetIndex)
setActiveSheet
in interface
Workbook
(接口 Workbook 中的 setActiveSheet)
sheetIndex
- index of the active sheet (0-based)
(sheetIndex - 活动工作表的索引(从 0 开始))
public int getFirstVisibleTab()
getFirstVisibleTab
in interface
Workbook
(接口 Workbook 中的 getFirstVisibleTab)
public void setFirstVisibleTab(int sheetIndex)
setFirstVisibleTab
in interface
Workbook
(界面 Workbook 中的 setFirstVisibleTab)
sheetIndex
- the first tab that to display in the list of tabs (0-based)
(sheetIndex - 在选项卡列表中显示的第一个选项卡(从 0 开始))
public void setSheetOrder(java.lang.String sheetname, int pos)
setSheetOrder
in interface
Workbook
(工作簿界面中的 setSheetOrder)
sheetname
- the name of the sheet to reorder
(sheetname - 要重新排序的工作表的名称)
pos
- the position that we want to insert the sheet into (0 based)
(pos - 我们要将工作表插入的位置(基于 0))
public void setSelectedTab(int index)
setSelectedTab
in interface
Workbook
(界面 Workbook 中的 setSelectedTab)
index
- the index of the sheet to select (0 based)
(index - 要选择的工作表的索引(基于 0))
Sheet.setSelected(boolean)
public void setSheetName(int sheet, java.lang.String name)
setSheetName
in interface
Workbook
(工作簿界面中的 setSheetName)
sheet
- number (0 based)
(工作表 - 编号(基于 0))
java.lang.IllegalArgumentException
- if the name is greater than 31 chars or contains
/\?*[]
(java.lang.IllegalArgumentException - 如果名称大于 31 个字符或包含 /?*[])
Workbook.createSheet(String)
,
WorkbookUtil.createSafeSheetName(String nameProposal)
public java.lang.String getSheetName(int sheet)
getSheetName
in interface
Workbook
(接口 Workbook 中的 getSheetName)
sheet
- sheet number (0 based)
(工作表 - 工作表编号(从 0 开始))
public int getSheetIndex(java.lang.String name)
getSheetIndex
in interface
Workbook
(接口 Workbook 中的 getSheetIndex)
name
- the sheet name
(name - 工作表名称)
public int getSheetIndex(Sheet sheet)
getSheetIndex
in interface
Workbook
(接口 Workbook 中的 getSheetIndex)
sheet
- the sheet to look up
(sheet - 要查找的工作表)
public SXSSFSheet createSheet()
createSheet
in interface
Workbook
(界面 Workbook 中的 createSheet)
public SXSSFSheet createSheet(java.lang.String sheetname)
createSheet
in interface
Workbook
(界面 Workbook 中的 createSheet)
sheetname
- sheetname to set for the sheet.
(sheetname - 为工作表设置的工作表名。)
java.lang.IllegalArgumentException
- if the name is greater than 31 chars or contains
/\?*[]
(java.lang.IllegalArgumentException - 如果名称大于 31 个字符或包含 /?*[])
WorkbookUtil.createSafeSheetName(String nameProposal)
@NotImplemented public Sheet cloneSheet(int sheetNum)
cloneSheet
in interface
Workbook
(界面 Workbook 中的 cloneSheet)
public int getNumberOfSheets()
getNumberOfSheets
in interface
Workbook
(接口 Workbook 中的 getNumberOfSheets)
public java.util.Iterator<Sheet> sheetIterator()
sheetIterator
in interface
Workbook
(接口 Workbook 中的 sheetIterator)
public java.util.Iterator<Sheet> iterator()
sheetIterator()
to allow foreach loops
(sheetIterator() 的别名以允许 foreach 循环)
iterator
in interface
java.lang.Iterable<Sheet>
(接口 java.lang.Iterable 中的迭代器
public SXSSFSheet getSheetAt(int index)
getSheetAt
in interface
Workbook
(接口 Workbook 中的 getSheetAt)
index
- of the sheet number (0-based physical and logical)
(index - 工作表编号(基于 0 的物理和逻辑))
public SXSSFSheet getSheet(java.lang.String name)
public void removeSheetAt(int index)
removeSheetAt
in interface
Workbook
(界面 Workbook 中的 removeSheetAt)
index
- of the sheet to remove (0-based)
(index - 要删除的工作表(从 0 开始))
public Font createFont()
createFont
in interface
Workbook
(界面 Workbook 中的 createFont)
public Font findFont(boolean bold, short color, short fontHeight, java.lang.String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
public int getNumberOfFonts()
Workbook
getNumberOfFonts
in interface
Workbook
(接口 Workbook 中的 getNumberOfFonts)
@Deprecated @Removal(version="6.0.0") public int getNumberOfFontsAsInt()
Workbook
getNumberOfFontsAsInt
in interface
Workbook
(接口 Workbook 中的 getNumberOfFontsAsInt)
public Font getFontAt(int idx)
Workbook
public CellStyle createCellStyle()
createCellStyle
in interface
Workbook
(界面 Workbook 中的 createCellStyle)
public int getNumCellStyles()
getNumCellStyles
in interface
Workbook
(接口 Workbook 中的 getNumCellStyles)
public CellStyle getCellStyleAt(int idx)
getCellStyleAt
in interface
Workbook
(接口 Workbook 中的 getCellStyleAt)
idx
- index within the set of styles (0-based)
(idx - 样式集中的索引(从 0 开始))
public void close() throws java.io.IOException
XSSFWorkbook
and
OPCPackage
on which this Workbook is based, if any.
Once this has been called, no further operations, updates or reads should be performed on the Workbook.
(关闭此工作簿所基于的基础 XSSFWorkbook 和 OPCPackage(如果有)。一旦调用了它,就不应在工作簿上执行进一步的操作、更新或读取。)public void write(java.io.OutputStream stream) throws java.io.IOException
protected void flushSheets() throws java.io.IOException
java.io.IOException
(java.io.IOException)
public boolean dispose()
public int getNumberOfNames()
getNumberOfNames
in interface
Workbook
(接口 Workbook 中的 getNumberOfNames)
public Name getName(java.lang.String name)
public java.util.List<? extends Name> getNames(java.lang.String name)
public java.util.List<? extends Name> getAllNames()
getAllNames
in interface
Workbook
(接口 Workbook 中的 getAllNames)
public Name createName()
createName
in interface
Workbook
(界面 Workbook 中的 createName)
public void removeName(Name name)
removeName
in interface
Workbook
(界面 Workbook 中的 removeName)
name
- the name to remove
(name - 要删除的名称)
public void setPrintArea(int sheetIndex, java.lang.String reference)
i.e. Reference = $A$1:$B$2
(设置提供的工作表的打印区域,即参考 = $A$1:$B$2)setPrintArea
in interface
Workbook
(界面 Workbook 中的 setPrintArea)
sheetIndex
- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
(sheetIndex - 从零开始的工作表索引(0 表示与 java 保持一致的第一个工作表))
reference
- Valid name Reference for the Print Area
(参考 - 打印区域的有效名称参考)
public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)
setPrintArea
in interface
Workbook
(界面 Workbook 中的 setPrintArea)
sheetIndex
- Zero-based sheet index (0 = First Sheet)
(sheetIndex - 从零开始的工作表索引(0 = 第一个工作表))
startColumn
- Column to begin printarea
(startColumn - 列开始 printarea)
endColumn
- Column to end the printarea
(endColumn - 结束打印区域的列)
startRow
- Row to begin the printarea
(startRow - 开始打印区域的行)
endRow
- Row to end the printarea
(endRow - 结束打印区域的行)
setPrintArea(int, String)
public java.lang.String getPrintArea(int sheetIndex)
getPrintArea
in interface
Workbook
(接口 Workbook 中的 getPrintArea)
sheetIndex
- Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
(sheetIndex - 从零开始的工作表索引(0 表示与 java 保持一致的第一个工作表))
public void removePrintArea(int sheetIndex)
removePrintArea
in interface
Workbook
(界面 Workbook 中的 removePrintArea)
sheetIndex
- Zero-based sheet index (0 = First Sheet)
(sheetIndex - 从零开始的工作表索引(0 = 第一个工作表))
public Row.MissingCellPolicy getMissingCellPolicy()
The default is to return blank and null cells. Row.MissingCellPolicy
getMissingCellPolicy
in interface
Workbook
(工作簿界面中的 getMissingCellPolicy)
public void setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)
Row.getCell(int)
. See
Row.MissingCellPolicy
(设置有关在一行中缺少单元格或空白单元格时要执行的操作的策略。这将适用于对 Row.getCell(int) 的所有调用。请参见 Row.MissingCellPolicy)
setMissingCellPolicy
in interface
Workbook
(接口 Workbook 中的 setMissingCellPolicy)
public DataFormat createDataFormat()
createDataFormat
in interface
Workbook
(接口 Workbook 中的 createDataFormat)
public int addPicture(byte[] pictureData, int format)
addPicture
in interface
Workbook
(界面 Workbook 中的 addPicture)
pictureData
- The bytes of the picture
(pictureData - 图片的字节数)
format
- The format of the picture.
(format - 图片的格式。)
Workbook.PICTURE_TYPE_EMF
,
Workbook.PICTURE_TYPE_WMF
,
Workbook.PICTURE_TYPE_PICT
,
Workbook.PICTURE_TYPE_JPEG
,
Workbook.PICTURE_TYPE_PNG
,
Workbook.PICTURE_TYPE_DIB
public java.util.List<? extends PictureData> getAllPictures()
getAllPictures
in interface
Workbook
(接口 Workbook 中的 getAllPictures)
PictureData
objects.)
(图片列表(PictureData 对象列表。))
public CreationHelper getCreationHelper()
getCreationHelper
in interface
Workbook
(接口 Workbook 中的 getCreationHelper)
protected boolean isDate1904()
@NotImplemented(value="XSSFWorkbook#isHidden is not implemented") public boolean isHidden()
@NotImplemented(value="XSSFWorkbook#setHidden is not implemented") public void setHidden(boolean hiddenFlag)
public boolean isSheetHidden(int sheetIx)
Workbook
Note that a sheet could instead be set to be very hidden, which is different (Workbook.isSheetVeryHidden(int)
)
isSheetHidden
in interface
Workbook
(isSheetHidden 在界面工作簿中)
sheetIx
- Number
(sheetIx - 编号)
true
if sheet is hidden
(如果工作表被隐藏,则为真)
Workbook.getSheetVisibility(int)
public boolean isSheetVeryHidden(int sheetIx)
Workbook
This is different from the normal hidden status (Workbook.isSheetHidden(int)
)
isSheetVeryHidden
in interface
Workbook
(isSheetVeryHidden 在界面工作簿中)
sheetIx
- sheet index to check
(sheetIx - 要检查的工作表索引)
true
if sheet is very hidden
(如果工作表非常隐藏,则为 true)
Workbook.getSheetVisibility(int)
public SheetVisibility getSheetVisibility(int sheetIx)
Workbook
getSheetVisibility
in interface
Workbook
(接口 Workbook 中的 getSheetVisibility)
sheetIx
- the index of the sheet
(sheetIx - 工作表的索引)
public void setSheetHidden(int sheetIx, boolean hidden)
Workbook
setSheetHidden
in interface
Workbook
(界面 Workbook 中的 setSheetHidden)
sheetIx
- the sheet index (0-based)
(sheetIx - 工作表索引(从 0 开始))
hidden
- True to mark the sheet as hidden, false otherwise
(hidden - True 将工作表标记为隐藏,否则为 false)
Workbook.setSheetVisibility(int, SheetVisibility)
public void setSheetVisibility(int sheetIx, SheetVisibility visibility)
Workbook
setSheetVisibility
in interface
Workbook
(界面 Workbook 中的 setSheetVisibility)
sheetIx
- the sheet index (0-based)
(sheetIx - 工作表索引(从 0 开始))
visibility
- the sheet visibility to set
(visibility - 要设置的工作表可见性)
@NotImplemented public int linkExternalWorkbook(java.lang.String name, Workbook workbook)
linkExternalWorkbook
in interface
Workbook
(接口工作簿中的链接外部工作簿)
name
- The name the workbook will be referenced as in formulas
(name - 将在公式中引用工作簿的名称)
workbook
- The open workbook to fetch the link required information from
(工作簿 - 用于从中获取链接所需信息的打开工作簿)
java.lang.RuntimeException
- stating that this method is not implemented yet.
(java.lang.RuntimeException - 说明此方法尚未实现。)
public void addToolPack(UDFFinder toopack)
addToolPack
in interface
Workbook
(界面 Workbook 中的 addToolPack)
toopack
- the toolpack to register
(Toopack - 要注册的工具包)
public 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 0, this flag will tell Excel that it needs to recalculate all formulas in the workbook the next time the file is opened.
(打开工作簿时应用程序是否应执行完全重新计算。通常,当您修改以前由 Excel 创建的工作簿的单元格公式或值时,您希望强制重新计算公式。当设置为 0 时,此标志将告诉 Excel 在下次打开文件时需要重新计算工作簿中的所有公式。)setForceFormulaRecalculation
in interface
Workbook
(接口 Workbook 中的 setForceFormulaRecalculation)
value
- true if the application will perform a full recalculation of workbook values when the workbook is opened
(value - 如果应用程序将在打开工作簿时完全重新计算工作簿值,则为 true)
public boolean getForceFormulaRecalculation()
getForceFormulaRecalculation
in interface
Workbook
(接口 Workbook 中的 getForceFormulaRecalculation)
public SpreadsheetVersion getSpreadsheetVersion()
getSpreadsheetVersion
in interface
Workbook
(接口 Workbook 中的 getSpreadsheetVersion)
public int addOlePackage(byte[] oleData, java.lang.String label, java.lang.String fileName, java.lang.String command) throws java.io.IOException
Workbook
addOlePackage
in interface
Workbook
(接口 Workbook 中的 addOlePackage)
oleData
- the payload
(oleData - 有效载荷)
label
- the label of the payload
(label - 有效负载的标签)
fileName
- the original filename
(fileName - 原始文件名)
command
- the command to open the payload
(command - 打开有效载荷的命令)
java.io.IOException
- if the object can't be embedded
(java.io.IOException - 如果无法嵌入对象)
public EvaluationWorkbook createEvaluationWorkbook()
createEvaluationWorkbook
in interface
Workbook
(接口 Workbook 中的 createEvaluationWorkbook)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.