public class SXSSFSheet extends java.lang.Object implements Sheet
Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.xssf.streaming.AutoSizeColumnTracker |
_autoSizeColumnTracker |
protected SXSSFWorkbook |
_workbook |
protected SheetDataWriter |
_writer |
BottomMargin, FooterMargin, HeaderMargin, LeftMargin, PANE_LOWER_LEFT, PANE_LOWER_RIGHT, PANE_UPPER_LEFT, PANE_UPPER_RIGHT, RightMargin, TopMargin
Modifier | Constructor and Description |
---|---|
|
SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) |
protected |
SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet, int randomAccessWindowSize) |
Modifier and Type | Method and Description |
---|---|
int |
addMergedRegion(CellRangeAddress region)
Adds a merged region of cells (hence those cells form one)
(添加单元格的合并区域(因此这些单元格形成一个))
|
int |
addMergedRegionUnsafe(CellRangeAddress region)
Adds a merged region of cells (hence those cells form one)
(添加单元格的合并区域(因此这些单元格形成一个))
|
void |
addValidationData(DataValidation dataValidation)
Creates a data validation object
(创建数据验证对象)
|
boolean |
areAllRowsFlushed()
Are all rows flushed to disk?
(所有行都刷新到磁盘吗?)
|
void |
autoSizeColumn(int column)
Adjusts the column width to fit the contents.
(调整列宽以适合内容。)
|
void |
autoSizeColumn(int column, boolean useMergedCells)
Adjusts the column width to fit the contents.
(调整列宽以适合内容。)
|
void |
changeRowNum(SXSSFRow row, int newRowNum) |
SXSSFDrawing |
createDrawingPatriarch()
Creates the top-level drawing patriarch.
(创建顶级图形族长。)
|
void |
createFreezePane(int colSplit, int rowSplit)
Creates a split (freezepane).
(创建一个拆分(冻结窗格)。)
|
void |
createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
Creates a split (freezepane).
(创建一个拆分(冻结窗格)。)
|
SXSSFRow |
createRow(int rownum)
Create a new row within the sheet and return the high level representation
(在工作表中创建一个新行并返回高级表示)
|
void |
createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
Creates a split pane.
(创建一个拆分窗格。)
|
void |
disableLocking()
Disable sheet protection
(禁用工作表保护)
|
void |
enableLocking()
Enable sheet protection
(启用工作表保护)
|
void |
flushRows()
Flush all rows to disk.
(将所有行刷新到磁盘。)
|
void |
flushRows(int remaining)
Specifies how many rows can be accessed at most via getRow().
(指定通过 getRow() 最多可以访问多少行。)
|
CellAddress |
getActiveCell()
Return location of the active cell, e.g.
(返回活动小区的位置,例如)
|
boolean |
getAutobreaks()
Flag indicating whether the sheet displays Automatic Page Breaks.
(指示工作表是否显示自动分页符的标志。)
|
XSSFComment |
getCellComment(CellAddress ref)
Returns cell comment for the specified row and column
(返回指定行和列的单元格注释)
|
java.util.Map<CellAddress,XSSFComment> |
getCellComments()
Returns all cell comments on this sheet.
(返回此工作表上的所有单元格注释。)
|
int[] |
getColumnBreaks()
Retrieves all the vertical page breaks
(检索所有垂直分页符)
|
int |
getColumnOutlineLevel(int columnIndex)
Returns the column outline level.
(返回列大纲级别。)
|
CellStyle |
getColumnStyle(int column)
Returns the CellStyle that applies to the given (0 based) column, or null if no style has been set for that column
(返回应用于给定(基于 0)列的 CellStyle,如果没有为该列设置样式,则返回 null)
|
int |
getColumnWidth(int columnIndex)
get the width (in units of 1/256th of a character width )
(获取宽度(以字符宽度的 1/256 为单位))
|
float |
getColumnWidthInPixels(int columnIndex)
Get the actual column width in pixels
(获取以像素为单位的实际列宽)
|
DataValidationHelper |
getDataValidationHelper() |
java.util.List<XSSFDataValidation> |
getDataValidations()
Returns the list of DataValidation in the sheet.
(返回工作表中的 DataValidation 列表。)
|
int |
getDefaultColumnWidth()
Get the default column width for the sheet (if the columns do not define their own width) in characters
(以字符为单位获取工作表的默认列宽(如果列未定义自己的宽度))
|
short |
getDefaultRowHeight()
Get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)
(获取工作表的默认行高(如果行没有定义自己的高度)以缇为单位(点的 1/20))
|
float |
getDefaultRowHeightInPoints()
Get the default row height for the sheet (if the rows do not define their own height) in points.
(获取工作表的默认行高(如果行没有定义自己的高度),以磅为单位。)
|
boolean |
getDisplayGuts()
Get whether to display the guts or not, default value is true
(获取是否显示胆量,默认值为true)
|
XSSFDrawing |
getDrawingPatriarch()
Return the sheet's existing drawing, or null if there isn't yet one.
(返回工作表的现有绘图,如果还没有,则返回 null。)
|
int |
getFirstRowNum()
Gets the first row on the sheet
(获取工作表的第一行)
|
boolean |
getFitToPage()
Flag indicating whether the Fit to Page print option is enabled.
(指示是否启用适合页面打印选项的标志。)
|
Footer |
getFooter()
Gets the user model for the default document footer.
(获取默认文档页脚的用户模型。)
|
boolean |
getForceFormulaRecalculation()
Whether Excel will be asked to recalculate all formulas when the workbook is opened.
(打开工作簿时是否会要求 Excel 重新计算所有公式。)
|
Header |
getHeader()
Gets the user model for the default document header.
(获取默认文档标题的用户模型。)
|
boolean |
getHorizontallyCenter()
Determine whether printed output for this sheet will be horizontally centered.
(确定此工作表的打印输出是否水平居中。)
|
XSSFHyperlink |
getHyperlink(CellAddress addr)
Get a Hyperlink in this sheet located in a cell specified by {code addr}
(在此工作表中获取位于 {code addr} 指定的单元格中的超链接)
|
XSSFHyperlink |
getHyperlink(int row, int column)
Get a Hyperlink in this sheet anchored at row, column
(在此工作表中获取锚定在行、列的超链接)
|
java.util.List<XSSFHyperlink> |
getHyperlinkList()
Get a list of Hyperlinks in this sheet
(获取此工作表中的超链接列表)
|
int |
getLastFlushedRowNum() |
int |
getLastRowNum()
Gets the last row on the sheet
(获取工作表的最后一行)
|
short |
getLeftCol()
The left col in the visible view when the sheet is first viewed after opening it in a viewer
(在查看器中打开工作表后首次查看工作表时可见视图中的左列)
|
double |
getMargin(short margin)
Gets the size of the margin in inches.
(以英寸为单位获取边距的大小。)
|
CellRangeAddress |
getMergedRegion(int index)
Returns the merged region at the specified index.
(返回指定索引处的合并区域。)
|
java.util.List<CellRangeAddress> |
getMergedRegions()
Returns the list of merged regions.
(返回合并区域的列表。)
|
int |
getNumMergedRegions()
Returns the number of merged regions
(返回合并区域的数量)
|
PaneInformation |
getPaneInformation()
Returns the information regarding the currently configured pane (split or freeze)
(返回有关当前配置的窗格的信息(拆分或冻结))
|
int |
getPhysicalNumberOfRows()
Returns the number of physically defined rows (NOT the number of rows in the sheet)
(返回物理定义的行数(不是工作表中的行数))
|
PrintSetup |
getPrintSetup()
Gets the print setup object.
(获取打印设置对象。)
|
boolean |
getProtect()
Answer whether protection is enabled or disabled
(回答保护是启用还是禁用)
|
CellRangeAddress |
getRepeatingColumns()
Gets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.
(获取打印工作表时使用的重复列,如 File->PageSetup->Sheet 中所示。)
|
CellRangeAddress |
getRepeatingRows()
Gets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet.
(获取打印工作表时使用的重复行,如 File->PageSetup->Sheet 中所示。)
|
SXSSFRow |
getRow(int rownum)
Returns the logical row (not physical) 0-based.
(返回基于 0 的逻辑行(非物理行)。)
|
int[] |
getRowBreaks()
Retrieves all the horizontal page breaks
(检索所有水平分页符)
|
int |
getRowNum(SXSSFRow row) |
boolean |
getRowSumsBelow()
Flag indicating whether summary rows appear below detail in an outline, when applying an outline.
(应用大纲时,指示摘要行是否出现在大纲中的详细信息下方的标志。)
|
boolean |
getRowSumsRight()
Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline.
(应用大纲时,指示摘要列是否显示在大纲中详细信息右侧的标志。)
|
boolean |
getScenarioProtect()
Answer whether scenario protection is enabled or disabled
(回答是否启用或禁用场景保护)
|
SheetConditionalFormatting |
getSheetConditionalFormatting()
The 'Conditional Formatting' facet for this
Sheet
(此工作表的“条件格式”方面)
|
java.lang.String |
getSheetName()
Returns the name of this sheet
(返回此工作表的名称)
|
XSSFColor |
getTabColor() |
short |
getTopRow()
The top row in the visible view when the sheet is first viewed after opening it in a viewer
(在查看器中打开工作表后首次查看工作表时可见视图中的顶行)
|
java.util.Set<java.lang.Integer> |
getTrackedColumnsForAutoSizing()
Get the currently tracked columns for auto-sizing.
(获取当前跟踪的列以进行自动调整大小。)
|
boolean |
getVerticallyCenter()
Determine whether printed output for this sheet will be vertically centered.
(确定此工作表的打印输出是否垂直居中。)
|
SXSSFWorkbook |
getWorkbook()
Return the parent workbook
(返回父工作簿)
|
java.io.InputStream |
getWorksheetXMLInputStream() |
void |
groupColumn(int fromColumn, int toColumn)
Create an outline for the provided column range.
(为提供的列范围创建大纲。)
|
void |
groupRow(int fromRow, int toRow)
Tie a range of rows together so that they can be collapsed or expanded
(将一系列行捆绑在一起,以便它们可以折叠或展开)
|
boolean |
isColumnBroken(int column)
Determines if there is a page break at the indicated column
(确定指示的列是否有分页符)
|
boolean |
isColumnHidden(int columnIndex)
Get the hidden state for a given column
(获取给定列的隐藏状态)
|
boolean |
isColumnTrackedForAutoSizing(int column)
Returns true if column is currently tracked for auto-sizing.
(如果当前跟踪列以进行自动调整大小,则返回 true。)
|
boolean |
isDisplayFormulas()
Returns if formulas are displayed
(返回是否显示公式)
|
boolean |
isDisplayGridlines()
Returns if gridlines are displayed
(返回是否显示网格线)
|
boolean |
isDisplayRowColHeadings()
Returns if RowColHeadings are displayed.
(如果显示 RowColHeadings,则返回。)
|
boolean |
isDisplayZeros()
Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.
(获取指示窗口是否应在包含零值的单元格中显示 0(零)的标志。)
|
boolean |
isPrintGridlines()
Returns whether gridlines are printed.
(返回是否打印网格线。)
|
boolean |
isPrintRowAndColumnHeadings()
Returns whether row and column headings are printed.
(返回是否打印行和列标题。)
|
boolean |
isRightToLeft()
Whether the text is displayed in right-to-left mode in the window
(文本是否在窗口中以从右到左的方式显示)
|
boolean |
isRowBroken(int row)
Determines if there is a page break at the indicated row
(确定指示行是否有分页符)
|
boolean |
isSelected()
Note - this is not the same as whether the sheet is focused (isActive)
(注意 - 这与工作表是否聚焦(isActive)不同)
|
java.util.Iterator<Row> |
iterator() |
void |
lockAutoFilter(boolean enabled)
Enable or disable Autofilters locking.
(启用或禁用自动过滤器锁定。)
|
void |
lockDeleteColumns(boolean enabled)
Enable or disable Deleting columns locking.
(启用或禁用删除列锁定。)
|
void |
lockDeleteRows(boolean enabled)
Enable or disable Deleting rows locking.
(启用或禁用删除行锁定。)
|
void |
lockFormatCells(boolean enabled)
Enable or disable Formatting cells locking.
(启用或禁用格式化单元格锁定。)
|
void |
lockFormatColumns(boolean enabled)
Enable or disable Formatting columns locking.
(启用或禁用格式化列锁定。)
|
void |
lockFormatRows(boolean enabled)
Enable or disable Formatting rows locking.
(启用或禁用格式化行锁定。)
|
void |
lockInsertColumns(boolean enabled)
Enable or disable Inserting columns locking.
(启用或禁用插入列锁定。)
|
void |
lockInsertHyperlinks(boolean enabled)
Enable or disable Inserting hyperlinks locking.
(启用或禁用插入超链接锁定。)
|
void |
lockInsertRows(boolean enabled)
Enable or disable Inserting rows locking.
(启用或禁用插入行锁定。)
|
void |
lockObjects(boolean enabled)
Enable or disable Objects locking.
(启用或禁用对象锁定。)
|
void |
lockPivotTables(boolean enabled)
Enable or disable Pivot Tables locking.
(启用或禁用数据透视表锁定。)
|
void |
lockScenarios(boolean enabled)
Enable or disable Scenarios locking.
(启用或禁用方案锁定。)
|
void |
lockSelectLockedCells(boolean enabled)
Enable or disable Selection of locked cells locking.
(启用或禁用锁定单元格锁定的选择。)
|
void |
lockSelectUnlockedCells(boolean enabled)
Enable or disable Selection of unlocked cells locking.
(启用或禁用选择未锁定的单元格锁定。)
|
void |
lockSort(boolean enabled)
Enable or disable Sort locking.
(启用或禁用排序锁定。)
|
void |
protectSheet(java.lang.String password)
Sets the protection enabled as well as the password
(设置启用的保护以及密码)
|
CellRange<? extends Cell> |
removeArrayFormula(Cell cell)
Remove a Array Formula from this sheet.
(从此工作表中删除一个数组公式。)
|
void |
removeColumnBreak(int column)
Removes a page break at the indicated column
(删除指定列的分页符)
|
void |
removeMergedRegion(int index)
Removes a merged region of cells (hence letting them free)
(删除合并的单元格区域(因此让它们自由))
|
void |
removeMergedRegions(java.util.Collection<java.lang.Integer> indices)
Removes a merged region of cells (hence letting them free)
(删除合并的单元格区域(因此让它们自由))
|
void |
removeRow(Row row)
Remove a row from this sheet.
(从此工作表中删除一行。)
|
void |
removeRowBreak(int row)
Removes the page break at the indicated row
(删除指定行的分页符)
|
java.util.Iterator<Row> |
rowIterator()
Returns an iterator of the physical rows
(返回物理行的迭代器)
|
void |
setActiveCell(CellAddress address)
Sets location of the active cell
(设置活动单元格的位置)
|
CellRange<? extends Cell> |
setArrayFormula(java.lang.String formula, CellRangeAddress range)
Sets array formula to specified region for result.
(将数组公式设置为结果的指定区域。)
|
void |
setAutobreaks(boolean value)
Flag indicating whether the sheet displays Automatic Page Breaks.
(指示工作表是否显示自动分页符的标志。)
|
AutoFilter |
setAutoFilter(CellRangeAddress range)
Enable filtering for a range of cells
(为一系列单元格启用过滤)
|
void |
setColumnBreak(int column)
Sets a page break at the indicated column
(在指示的列处设置分页符)
|
void |
setColumnGroupCollapsed(int columnNumber, boolean collapsed)
Expands or collapses a column group.
(展开或折叠列组。)
|
void |
setColumnHidden(int columnIndex, boolean hidden)
Get the visibility state for a given column
(获取给定列的可见性状态)
|
void |
setColumnWidth(int columnIndex, int width)
Set the width (in units of 1/256th of a character width)
(设置宽度(以字符宽度的 1/256 为单位))
|
void |
setDefaultColumnStyle(int column, CellStyle style)
Sets the default column style for a given column.
(设置给定列的默认列样式。)
|
void |
setDefaultColumnWidth(int width)
Set the default column width for the sheet (if the columns do not define their own width) in characters
(以字符为单位设置工作表的默认列宽(如果列未定义自己的宽度))
|
void |
setDefaultRowHeight(short height)
Set the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)
(设置工作表的默认行高(如果行没有定义自己的高度)以缇为单位(1/20 点))
|
void |
setDefaultRowHeightInPoints(float height)
Set the default row height for the sheet (if the rows do not define their own height) in points
(以磅为单位设置工作表的默认行高(如果行没有定义自己的高度))
|
void |
setDisplayFormulas(boolean show)
Sets whether the formulas are shown in a viewer
(设置公式是否显示在查看器中)
|
void |
setDisplayGridlines(boolean show)
Sets whether the gridlines are shown in a viewer
(设置是否在查看器中显示网格线)
|
void |
setDisplayGuts(boolean value)
Set whether to display the guts or not
(设置是否显示胆量)
|
void |
setDisplayRowColHeadings(boolean show)
Sets whether the RowColHeadings are shown in a viewer
(设置 RowColHeadings 是否显示在查看器中)
|
void |
setDisplayZeros(boolean value)
Set whether the window should show 0 (zero) in cells containing zero value.
(设置窗口是否应在包含零值的单元格中显示 0(零)。)
|
void |
setFitToPage(boolean value)
Flag indicating whether the Fit to Page print option is enabled.
(指示是否启用适合页面打印选项的标志。)
|
void |
setForceFormulaRecalculation(boolean value)
Control if Excel should be asked to recalculate all formulas when the workbook is opened, via the "sheetCalcPr fullCalcOnLoad" option.
(通过“sheetCalcPr fullCalcOnLoad”选项控制是否应在打开工作簿时要求 Excel 重新计算所有公式。)
|
void |
setHorizontallyCenter(boolean value)
Determines whether the output is horizontally centered on the page.
(确定输出是否在页面上水平居中。)
|
void |
setMargin(short margin, double size)
Sets the size of the margin in inches.
(以英寸为单位设置边距的大小。)
|
void |
setPrintGridlines(boolean show)
Turns on or off the printing of gridlines.
(打开或关闭网格线的打印。)
|
void |
setPrintRowAndColumnHeadings(boolean show)
Turns on or off the printing of row and column headings.
(打开或关闭行和列标题的打印。)
|
void |
setRandomAccessWindowSize(int value)
Specifies how many rows can be accessed at most via getRow().
(指定通过 getRow() 最多可以访问多少行。)
|
void |
setRepeatingColumns(CellRangeAddress columnRangeRef)
Sets the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.
(设置打印工作表时使用的重复列,如 File->PageSetup->Sheet 中所示。)
|
void |
setRepeatingRows(CellRangeAddress rowRangeRef)
Sets the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet.
(设置打印工作表时使用的重复行,如 File->PageSetup->Sheet 中所示。)
|
void |
setRightToLeft(boolean value)
Sets whether the worksheet is displayed from right to left instead of from left to right.
(设置工作表是否从右到左而不是从左到右显示。)
|
void |
setRowBreak(int row)
Sets a page break at the indicated row
(在指定行设置分页符)
|
void |
setRowGroupCollapsed(int row, boolean collapse)
Set view state of a grouped range of rows.
(设置一组行的视图状态。)
|
void |
setRowOutlineLevel(int rownum, int level)
Set row groupings (like groupRow) in a stream-friendly manner
(以流友好的方式设置行分组(如 groupRow))
|
void |
setRowSumsBelow(boolean value)
Flag indicating whether summary rows appear below detail in an outline, when applying an outline.
(应用大纲时,指示摘要行是否出现在大纲中的详细信息下方的标志。)
|
void |
setRowSumsRight(boolean value)
Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline.
(应用大纲时,指示摘要列是否显示在大纲中详细信息右侧的标志。)
|
void |
setSelected(boolean value)
Sets a flag indicating whether this sheet is selected.
(设置一个标志,指示此工作表是否被选中。)
|
void |
setTabColor(int colorIndex)
Set background color of the sheet tab
(设置工作表标签的背景颜色)
|
void |
setTabColor(XSSFColor color) |
void |
setVerticallyCenter(boolean value)
Determines whether the output is vertically centered on the page.
(确定输出是否在页面上垂直居中。)
|
void |
setZoom(int scale)
Window zoom magnification for current view representing percent values.
(表示百分比值的当前视图的窗口缩放比例。)
|
void |
shiftColumns(int startColumn, int endColumn, int n)
Shifts columns between startColumn and endColumn, n number of columns.
(在 startColumn 和 endColumn 之间移动列,n 列。)
|
void |
shiftRows(int startRow, int endRow, int n)
Not implemented for SXSSFSheets Shifts rows between startRow and endRow n number of rows.
(未针对 SXSSFSheets 实现 在 startRow 和 endRow 之间移动 n 行。)
|
void |
shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Not implemented for SXSSFSheets Shifts rows between startRow and endRow n number of rows.
(未针对 SXSSFSheets 实现 在 startRow 和 endRow 之间移动 n 行。)
|
void |
showInPane(int topRow, int leftCol)
Sets desktop window pane display area, when the file is first opened in a viewer.
(当文件第一次在查看器中打开时,设置桌面窗口窗格的显示区域。)
|
void |
trackAllColumnsForAutoSizing()
Tracks all columns in the sheet for auto-sizing.
(跟踪工作表中的所有列以自动调整大小。)
|
void |
trackColumnForAutoSizing(int column)
Track a column in the sheet for auto-sizing.
(跟踪工作表中的列以自动调整大小。)
|
void |
trackColumnsForAutoSizing(java.util.Collection<java.lang.Integer> columns)
Track several columns in the sheet for auto-sizing.
(跟踪工作表中的几列以自动调整大小。)
|
void |
ungroupColumn(int fromColumn, int toColumn)
Ungroup a range of columns that were previously groupped
(取消对先前分组的一系列列的分组)
|
void |
ungroupRow(int fromRow, int toRow)
Ungroup a range of rows that were previously groupped
(取消组合之前分组的一系列行)
|
void |
untrackAllColumnsForAutoSizing()
Untracks all columns in the sheet for auto-sizing.
(取消跟踪工作表中的所有列以自动调整大小。)
|
boolean |
untrackColumnForAutoSizing(int column)
Removes a column that was previously marked for inclusion in auto-size column tracking.
(删除以前标记为包含在自动大小列跟踪中的列。)
|
boolean |
untrackColumnsForAutoSizing(java.util.Collection<java.lang.Integer> columns)
Untracks several columns in the sheet for auto-sizing.
(取消跟踪工作表中的几列以自动调整大小。)
|
void |
validateMergedRegions()
Verify that merged regions do not intersect multi-cell array formulas and no merged regions intersect another merged region in this sheet.
(验证合并区域不会与多单元格数组公式相交,并且没有合并区域与此工作表中的另一个合并区域相交。)
|
protected final SXSSFWorkbook _workbook
protected SheetDataWriter _writer
protected final org.apache.poi.xssf.streaming.AutoSizeColumnTracker _autoSizeColumnTracker
protected SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet, int randomAccessWindowSize)
public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public java.io.InputStream getWorksheetXMLInputStream() throws java.io.IOException
java.io.IOException
(java.io.IOException)
public java.util.Iterator<Row> iterator()
iterator
in interface
java.lang.Iterable<Row>
(接口 java.lang.Iterable 中的迭代器
public SXSSFRow createRow(int rownum)
createRow
in interface
Sheet
(界面Sheet中的createRow)
rownum
- row number
(rownum - 行号)
java.lang.IllegalArgumentException
- If the max. number of rows is exceeded or a rownum is provided where the row is already flushed to disk.
(java.lang.IllegalArgumentException - 如果最大值。超出了行数,或者在行已刷新到磁盘的情况下提供了 rownum。)
removeRow(Row)
public void removeRow(Row row)
public SXSSFRow getRow(int rownum)
public int getPhysicalNumberOfRows()
getPhysicalNumberOfRows
in interface
Sheet
(接口表中的 getPhysicalNumberOfRows)
public int getFirstRowNum()
getFirstRowNum
in interface
Sheet
(接口表中的 getFirstRowNum)
public int getLastRowNum()
getLastRowNum
in interface
Sheet
(接口表中的 getLastRowNum)
public void setColumnHidden(int columnIndex, boolean hidden)
setColumnHidden
in interface
Sheet
(界面Sheet中的setColumnHidden)
columnIndex
- - the column to get (0-based)
(columnIndex - - 要获取的列(从 0 开始))
hidden
- - the visiblity state of the column
(hidden - - 列的可见性状态)
public boolean isColumnHidden(int columnIndex)
isColumnHidden
in interface
Sheet
(isColumnHidden 在界面表中)
columnIndex
- - the column to set (0-based)
(columnIndex - - 要设置的列(从 0 开始))
false
if the column is visible
(hidden - 如果该列可见,则为 false)
public void setColumnWidth(int columnIndex, int width)
The maximum column width for an individual cell is 255 characters. This value represents the number of characters that can be displayed in a cell that is formatted with the standard font.
(设置宽度(以字符宽度的 1/256 为单位) 单个单元格的最大列宽为 255 个字符。此值表示可以在使用标准字体格式化的单元格中显示的字符数。)setColumnWidth
in interface
Sheet
(界面Sheet中的setColumnWidth)
columnIndex
- - the column to set (0-based)
(columnIndex - - 要设置的列(从 0 开始))
width
- - the width in units of 1/256th of a character width
(width - 以字符宽度的 1/256 为单位的宽度)
public int getColumnWidth(int columnIndex)
getColumnWidth
in interface
Sheet
(接口表中的getColumnWidth)
columnIndex
- - the column to set (0-based)
(columnIndex - - 要设置的列(从 0 开始))
public float getColumnWidthInPixels(int columnIndex)
Please note, that this method works correctly only for workbooks with the default font size (Calibri 11pt for .xlsx).
(获取以像素为单位的实际列宽 请注意,此方法仅适用于具有默认字体大小的工作簿(Calibri 11pt for .xlsx)。)getColumnWidthInPixels
in interface
Sheet
(接口表中的 getColumnWidthInPixels)
columnIndex
- - the column to set (0-based)
(columnIndex - - 要设置的列(从 0 开始))
public void setDefaultColumnWidth(int width)
setDefaultColumnWidth
in interface
Sheet
(界面表中的 setDefaultColumnWidth)
width
- default column width measured in characters
(width - 以字符为单位的默认列宽)
public int getDefaultColumnWidth()
getDefaultColumnWidth
in interface
Sheet
(接口表中的getDefaultColumnWidth)
public short getDefaultRowHeight()
getDefaultRowHeight
in interface
Sheet
(接口表中的getDefaultRowHeight)
public float getDefaultRowHeightInPoints()
getDefaultRowHeightInPoints
in interface
Sheet
(接口表中的 getDefaultRowHeightInPoints)
public void setDefaultRowHeight(short height)
setDefaultRowHeight
in interface
Sheet
(接口表中的 setDefaultRowHeight)
height
- default row height measured in twips (1/20 of a point)
(height - 以缇为单位的默认行高(1/20 点))
public void setDefaultRowHeightInPoints(float height)
setDefaultRowHeightInPoints
in interface
Sheet
(接口表中的 setDefaultRowHeightInPoints)
height
- default row height
(height - 默认行高)
public CellStyle getColumnStyle(int column)
getColumnStyle
in interface
Sheet
(界面Sheet中的getColumnStyle)
public int addMergedRegion(CellRangeAddress region)
addMergedRegion
in interface
Sheet
(界面Sheet中的addMergedRegion)
region
- (rowfrom/colfrom-rowto/colto) to merge
(region - (rowfrom/colfrom-rowto/colto) 合并)
public int addMergedRegionUnsafe(CellRangeAddress region)
addMergedRegionUnsafe
in interface
Sheet
(接口 Sheet 中的 addMergedRegionUnsafe)
region
- (rowfrom/colfrom-rowto/colto) to merge
(region - (rowfrom/colfrom-rowto/colto) 合并)
public void validateMergedRegions()
validateMergedRegions
in interface
Sheet
(接口表中的 validateMergedRegions)
java.lang.IllegalStateException
- if region intersects with a multi-cell array formula
(java.lang.IllegalStateException - 如果区域与多单元格数组公式相交)
java.lang.IllegalStateException
- if at least one region intersects with another merged region in this sheet
(java.lang.IllegalStateException - 如果至少一个区域与此工作表中的另一个合并区域相交)
public void setVerticallyCenter(boolean value)
setVerticallyCenter
in interface
Sheet
(界面Sheet中的setVerticallyCenter)
value
- true to vertically center, false otherwise.
(value - 垂直居中为真,否则为假。)
public void setHorizontallyCenter(boolean value)
setHorizontallyCenter
in interface
Sheet
(界面Sheet中的setHorizontallyCenter)
value
- true to horizontally center, false otherwise.
(value - 水平居中为真,否则为假。)
public boolean getHorizontallyCenter()
getHorizontallyCenter
in interface
Sheet
(界面表中的getHorizontallyCenter)
public boolean getVerticallyCenter()
getVerticallyCenter
in interface
Sheet
(界面表中的getVerticalCenter)
public void removeMergedRegion(int index)
removeMergedRegion
in interface
Sheet
(接口表中的 removeMergedRegion)
index
- of the region to unmerge
(index - 要取消合并的区域)
public void removeMergedRegions(java.util.Collection<java.lang.Integer> indices)
removeMergedRegions
in interface
Sheet
(接口表中的 removeMergedRegions)
indices
- of the regions to unmerge
(指数 - 要取消合并的区域)
public int getNumMergedRegions()
getNumMergedRegions
in interface
Sheet
(接口表中的 getNumMergedRegions)
public CellRangeAddress getMergedRegion(int index)
getMergedRegions()
than to call this each time.
(返回指定索引处的合并区域。如果您想要多个区域,调用 getMergedRegions() 比每次调用它更快。)
getMergedRegion
in interface
Sheet
(接口表中的getMergedRegion)
public java.util.List<CellRangeAddress> getMergedRegions()
getMergedRegion(int)
each time.
(返回合并区域的列表。如果您想要多个区域,这比每次调用 getMergedRegion(int) 更快。)
getMergedRegions
in interface
Sheet
(接口表中的 getMergedRegions)
public java.util.Iterator<Row> rowIterator()
rowIterator
in interface
Sheet
(界面Sheet中的rowIterator)
public void setAutobreaks(boolean value)
setAutobreaks
in interface
Sheet
(界面表中的 setAutobreaks)
value
-
true
if the sheet displays Automatic Page Breaks.
(value - 如果工作表显示自动分页符,则为 true。)
public void setDisplayGuts(boolean value)
setDisplayGuts
in interface
Sheet
(界面表中的 setDisplayGuts)
value
- - guts or no guts
(价值 - - 有胆量或没有胆量)
public void setDisplayZeros(boolean value)
setDisplayZeros
in interface
Sheet
(界面表中的 setDisplayZeros)
value
- whether to display or hide all zero values on the worksheet
(value - 是否在工作表上显示或隐藏所有零值)
public boolean isDisplayZeros()
isDisplayZeros
in interface
Sheet
(界面表中的 isDisplayZeros)
public void setRightToLeft(boolean value)
setRightToLeft
in interface
Sheet
(界面Sheet中的setRightToLeft)
value
- true for right to left, false otherwise.
(value - 从右到左为 true,否则为 false。)
public boolean isRightToLeft()
isRightToLeft
in interface
Sheet
(界面表中的 isRightToLeft)
public void setFitToPage(boolean value)
setFitToPage
in interface
Sheet
(界面Sheet中的setFitToPage)
value
-
true
if the Fit to Page print option is enabled.
(value - 如果启用了适合页面打印选项,则为 true。)
public void setRowSumsBelow(boolean value)
When true a summary row is inserted below the detailed data being summarized and a new outline level is established on that row.
When false a summary row is inserted above the detailed data being summarized and a new outline level is established on that row.
(应用大纲时,指示摘要行是否出现在大纲中的详细信息下方的标志。如果为真,则在要汇总的详细数据下方插入汇总行,并在该行上建立新的大纲级别。如果为 false,则在要汇总的详细数据上方插入汇总行,并在该行上建立新的大纲级别。)setRowSumsBelow
in interface
Sheet
(界面Sheet中的setRowSumsBelow)
value
-
true
if row summaries appear below detail in the outline
(value - 如果行摘要出现在大纲中的详细信息下方,则为 true)
public void setRowSumsRight(boolean value)
When true a summary column is inserted to the right of the detailed data being summarized and a new outline level is established on that column.
When false a summary column is inserted to the left of the detailed data being summarized and a new outline level is established on that column.
(应用大纲时,指示摘要列是否显示在大纲中详细信息右侧的标志。如果为 true,则在正在汇总的详细数据的右侧插入一个汇总列,并在该列上建立一个新的大纲级别。如果为 false,则在要汇总的详细数据的左侧插入汇总列,并在该列上建立新的大纲级别。)setRowSumsRight
in interface
Sheet
(接口表中的 setRowSumsRight)
value
-
true
if col summaries appear right of the detail in the outline
(value - 如果 col 摘要出现在大纲中详细信息的右侧,则为 true)
public boolean getAutobreaks()
getAutobreaks
in interface
Sheet
(接口表中的 getAutobreaks)
true
if the sheet displays Automatic Page Breaks.
(如果工作表显示自动分页符,则为 true。)
public boolean getDisplayGuts()
getDisplayGuts
in interface
Sheet
(接口表中的 getDisplayGuts)
public boolean getFitToPage()
getFitToPage
in interface
Sheet
(接口表中的getFitToPage)
true
if the Fit to Page print option is enabled.
(如果启用了适合页面打印选项,则为 true。)
public boolean getRowSumsBelow()
When true a summary row is inserted below the detailed data being summarized and a new outline level is established on that row.
When false a summary row is inserted above the detailed data being summarized and a new outline level is established on that row.
(应用大纲时,指示摘要行是否出现在大纲中的详细信息下方的标志。如果为真,则在要汇总的详细数据下方插入汇总行,并在该行上建立新的大纲级别。如果为 false,则在要汇总的详细数据上方插入汇总行,并在该行上建立新的大纲级别。)getRowSumsBelow
in interface
Sheet
(接口表中的getRowSumsBelow)
true
if row summaries appear below detail in the outline
(如果行摘要出现在大纲中的详细信息下方,则为 true)
public boolean getRowSumsRight()
When true a summary column is inserted to the right of the detailed data being summarized and a new outline level is established on that column.
When false a summary column is inserted to the left of the detailed data being summarized and a new outline level is established on that column.
(应用大纲时,指示摘要列是否显示在大纲中详细信息右侧的标志。如果为 true,则在正在汇总的详细数据的右侧插入一个汇总列,并在该列上建立一个新的大纲级别。如果为 false,则在要汇总的详细数据的左侧插入汇总列,并在该列上建立新的大纲级别。)getRowSumsRight
in interface
Sheet
(接口表中的 getRowSumsRight)
true
if col summaries appear right of the detail in the outline
(如果 col 摘要出现在大纲中详细信息的右侧,则为 true)
public boolean isPrintGridlines()
isPrintGridlines
in interface
Sheet
(界面Sheet中的isPrintGridlines)
to check if gridlines are displayed on screen
public void setPrintGridlines(boolean show)
setPrintGridlines
in interface
Sheet
(界面Sheet中的setPrintGridlines)
show
- boolean to turn on or off the printing of gridlines
(show - 用于打开或关闭网格线打印的布尔值)
to display gridlines on screen
public boolean isPrintRowAndColumnHeadings()
isPrintRowAndColumnHeadings
in interface
Sheet
(界面Sheet中的isPrintRowAndColumnHeadings)
public void setPrintRowAndColumnHeadings(boolean show)
setPrintRowAndColumnHeadings
in interface
Sheet
(界面Sheet中的setPrintRowAndColumnHeadings)
show
- boolean to turn on or off the printing of row and column headings
(show - 布尔值,用于打开或关闭行和列标题的打印)
public PrintSetup getPrintSetup()
getPrintSetup
in interface
Sheet
(接口Sheet中的getPrintSetup)
public Header getHeader()
Note that XSSF offers more kinds of document headers than HSSF does
(获取默认文档标题的用户模型。请注意,XSSF 提供比 HSSF 更多种类的文档标题)public Footer getFooter()
Note that XSSF offers more kinds of document footers than HSSF does.
(获取默认文档页脚的用户模型。请注意,XSSF 提供的文档页脚种类比 HSSF 多。)public void setSelected(boolean value)
Note: multiple sheets can be selected, but only one sheet can be active at one time.
(设置一个标志,指示此工作表是否被选中。注意:可以选择多张工作表,但一次只能激活一张工作表。)setSelected
in interface
Sheet
(界面Sheet中的setSelected)
value
-
true
if this sheet is selected
(value - 如果选择了此工作表,则为 true)
Workbook.setActiveSheet(int)
public double getMargin(short margin)
public void setMargin(short margin, double size)
public boolean getProtect()
getProtect
in interface
Sheet
(接口表中的getProtect)
public void protectSheet(java.lang.String password)
protectSheet
in interface
Sheet
(界面Sheet中的protectSheet)
password
- to set for protection. Pass
null
to remove protection
(密码 - 设置保护。传递 null 以删除保护)
public boolean getScenarioProtect()
getScenarioProtect
in interface
Sheet
(接口表中的 getScenarioProtect)
public void setZoom(int scale)
10 - 10% 20 - 20% ... 100 - 100% ... 400 - 400%Current view can be Normal, Page Layout, or Page Break Preview. (表示百分比值的当前视图的窗口缩放比例。有效值范围从 10 到 400。水平和垂直比例一起。例如:10 - 10% 20 - 20% ... 100 - 100% ... 400 - 400% 当前视图可以是“普通”、“页面布局”或“分页预览”。)
public short getTopRow()
public short getLeftCol()
getLeftCol
in interface
Sheet
(接口表中的 getLeftCol)
public void showInPane(int topRow, int leftCol)
showInPane
in interface
Sheet
(界面工作表中的 showInPane)
topRow
- the top row to show in desktop window pane
(topRow - 在桌面窗口窗格中显示的第一行)
leftCol
- the left column to show in desktop window pane
(leftCol - 要在桌面窗口窗格中显示的左列)
public void setForceFormulaRecalculation(boolean value)
FormulaEvaluator
is the recommended solution, but this may be used for certain cases where evaluation in POI is not possible.
(通过“sheetCalcPr fullCalcOnLoad”选项控制是否应在打开工作簿时要求 Excel 重新计算所有公式。使用 FormulaEvaluator 计算公式值是推荐的解决方案,但这可能用于无法在 POI 中进行评估的某些情况。)
setForceFormulaRecalculation
in interface
Sheet
(接口Sheet中的setForceFormulaRecalculation)
value
- true if the application will perform a full recalculation of this worksheet values when the workbook is opened
(value - 如果应用程序将在打开工作簿时完全重新计算此工作表值,则为 true)
Workbook.setForceFormulaRecalculation(boolean)
public boolean getForceFormulaRecalculation()
getForceFormulaRecalculation
in interface
Sheet
(接口表中的getForceFormulaRecalculation)
@NotImplemented public void shiftRows(int startRow, int endRow, int n)
Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).
(未针对 SXSSFSheets 实现 在 startRow 和 endRow 之间移动 n 行。如果您使用负数,它将向上移动行。代码确保行不会环绕。调用 shiftRows(startRow, endRow, n, false, false);另外移动在这些行中完全定义的合并区域(即,在要移动的行上合并 2 个单元格)。)@NotImplemented public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted). All merged regions that are completely overlaid by shifting will be deleted.
(未针对 SXSSFSheets 实现 在 startRow 和 endRow 之间移动 n 行。如果您使用负数,它将向上移动行。代码确保行不会环绕另外移动在这些行中完全定义的合并区域(即,在要移动的行上合并 2 个单元格)。所有被移位完全覆盖的合并区域将被删除。)shiftRows
in interface
Sheet
(界面工作表中的 shiftRows)
startRow
- the row to start shifting
(startRow - 开始移动的行)
endRow
- the row to end shifting
(endRow - 结束移位的行)
n
- the number of rows to shift
(n - 要移动的行数)
copyRowHeight
- whether to copy the row height during the shift
(copyRowHeight - 是否在班次期间复制行高)
resetOriginalRowHeight
- whether to set the original row's height to the default
(resetOriginalRowHeight - 是否将原始行的高度设置为默认值)
public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
createFreezePane
in interface
Sheet
(界面Sheet中的createFreezePane)
colSplit
- Horizonatal position of split.
(colSplit - 分割的水平位置。)
rowSplit
- Vertical position of split.
(rowSplit - 拆分的垂直位置。)
leftmostColumn
- Left column visible in right pane.
(leftmostColumn - 在右窗格中可见的左列。)
topRow
- Top row visible in bottom pane
(topRow - 在底部窗格中可见的顶行)
public void createFreezePane(int colSplit, int rowSplit)
createFreezePane
in interface
Sheet
(界面Sheet中的createFreezePane)
colSplit
- Horizonatal position of split.
(colSplit - 分割的水平位置。)
rowSplit
- Vertical position of split.
(rowSplit - 拆分的垂直位置。)
public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
createSplitPane
in interface
Sheet
(界面Sheet中的createSplitPane)
xSplitPos
- Horizonatal position of split (in 1/20th of a point).
(xSplitPos - 分割的水平位置(点的 1/20)。)
ySplitPos
- Vertical position of split (in 1/20th of a point).
(ySplitPos - 分割的垂直位置(点的 1/20)。)
topRow
- Top row visible in bottom pane
(topRow - 在底部窗格中可见的顶行)
leftmostColumn
- Left column visible in right pane.
(leftmostColumn - 在右窗格中可见的左列。)
activePane
- Active pane. One of: PANE_LOWER_RIGHT, PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
(activePane - 活动窗格。以下之一:PANE_LOWER_RIGHT、PANE_UPPER_RIGHT、PANE_LOWER_LEFT、PANE_UPPER_LEFT)
Sheet.PANE_LOWER_LEFT
,
Sheet.PANE_LOWER_RIGHT
,
Sheet.PANE_UPPER_LEFT
,
Sheet.PANE_UPPER_RIGHT
public PaneInformation getPaneInformation()
getPaneInformation
in interface
Sheet
(界面Sheet中的getPaneInformation)
public void setDisplayGridlines(boolean show)
setDisplayGridlines
in interface
Sheet
(界面Sheet中的setDisplayGridlines)
show
- whether to show gridlines or not
(show - 是否显示网格线)
public boolean isDisplayGridlines()
isDisplayGridlines
in interface
Sheet
(界面表中的 isDisplayGridlines)
public void setDisplayFormulas(boolean show)
setDisplayFormulas
in interface
Sheet
(界面表中的 setDisplayFormulas)
show
- whether to show formulas or not
(show - 是否显示公式)
public boolean isDisplayFormulas()
isDisplayFormulas
in interface
Sheet
(界面表中的 isDisplayFormulas)
public void setDisplayRowColHeadings(boolean show)
setDisplayRowColHeadings
in interface
Sheet
(界面表中的 setDisplayRowColHeadings)
show
- whether to show RowColHeadings or not
(show - 是否显示 RowColHeadings)
public boolean isDisplayRowColHeadings()
isDisplayRowColHeadings
in interface
Sheet
(界面表中的 isDisplayRowColHeadings)
public void setRowBreak(int row)
setRowBreak
in interface
Sheet
(接口表中的 setRowBreak)
row
- FIXME: Document this!
(行 - FIXME:记录这个!)
public boolean isRowBroken(int row)
isRowBroken
in interface
Sheet
(isRowBroken 在接口表中)
row
- The row to check
(row - 要检查的行)
public void removeRowBreak(int row)
removeRowBreak
in interface
Sheet
(接口表中的 removeRowBreak)
row
- The row to remove page breaks from
(row - 要从中删除分页符的行)
public int[] getRowBreaks()
getRowBreaks
in interface
Sheet
(接口表中的 getRowBreaks)
public int[] getColumnBreaks()
getColumnBreaks
in interface
Sheet
(接口表中的 getColumnBreaks)
public void setColumnBreak(int column)
setColumnBreak
in interface
Sheet
(接口表中的 setColumnBreak)
column
- The column to work on
(column - 要处理的列)
public boolean isColumnBroken(int column)
isColumnBroken
in interface
Sheet
(isColumnBroken 在接口表中)
column
- The column to check for page breaks
(column - 检查分页符的列)
public void removeColumnBreak(int column)
removeColumnBreak
in interface
Sheet
(界面表中的 removeColumnBreak)
column
- The column to remove a page break from
(column - 要从中删除分页符的列)
public void setColumnGroupCollapsed(int columnNumber, boolean collapsed)
setColumnGroupCollapsed
in interface
Sheet
(界面Sheet中的setColumnGroupCollapsed)
columnNumber
- One of the columns in the group.
(columnNumber - 组中的列之一。)
collapsed
- true = collapse group, false = expand group.
(折叠 - true = 折叠组,false = 展开组。)
public void groupColumn(int fromColumn, int toColumn)
groupColumn
in interface
Sheet
(界面Sheet中的groupColumn)
fromColumn
- beginning of the column range.
(fromColumn - 列范围的开始。)
toColumn
- end of the column range.
(toColumn - 列范围的结尾。)
public void ungroupColumn(int fromColumn, int toColumn)
ungroupColumn
in interface
Sheet
(界面Sheet中的ungroupColumn)
fromColumn
- start column (0-based)
(fromColumn - 起始列(从 0 开始))
toColumn
- end column (0-based)
(toColumn - 结束列(从 0 开始))
public void groupRow(int fromRow, int toRow)
Please note the rows being grouped must be in the current window, if the rows are already flushed then groupRow has no effect.
Correct code:
Workbook wb = new SXSSFWorkbook(100); // keep 100 rows in memory
Sheet sh = wb.createSheet();
for (int rownum = 0; rownum < 1000; rownum++) {
Row row = sh.createRow(rownum);
if(rownum == 200) {
sh.groupRow(100, 200);
}
}
Incorrect code:
Workbook wb = new SXSSFWorkbook(100); // keep 100 rows in memory
Sheet sh = wb.createSheet();
for (int rownum = 0; rownum < 1000; rownum++) {
Row row = sh.createRow(rownum);
}
sh.groupRow(100, 200); // the rows in the range [100, 200] are already flushed and groupRows has no effect
(将一系列行捆绑在一起,以便它们可以折叠或展开 请注意被分组的行必须在当前窗口中,如果行已经被刷新,则 groupRow 无效。正确代码:Workbook wb = new SXSSFWorkbook(100); // 在内存中保留 100 行 Sheet sh = wb.createSheet(); for (int rownum = 0; rownum < 1000; rownum++) { 行行 = sh.createRow(rownum); if(rownum == 200) { sh.groupRow(100, 200); } } 不正确的代码:Workbook wb = new SXSSFWorkbook(100); // 在内存中保留 100 行 Sheet sh = wb.createSheet(); for (int rownum = 0; rownum < 1000; rownum++) { 行行 = sh.createRow(rownum); } sh.groupRow(100, 200); // [100, 200] 范围内的行已经被刷新,groupRows 没有效果)
public void setRowOutlineLevel(int rownum, int level)
groupRows requires all rows in the group to be in the current window. This is not always practical. Instead use setRowOutlineLevel to explicitly set the group level. Level 1 is the top level group, followed by 2, etc. It is up to the user to ensure that level 2 groups are correctly nested under level 1, etc.
(以流友好的方式设置行分组(如 groupRow) groupRows 要求组中的所有行都在当前窗口中。这并不总是实用的。而是使用 setRowOutlineLevel 显式设置组级别。级别 1 是顶级组,其次是 2,依此类推。由用户确保级别 2 组正确嵌套在级别 1 下,依此类推。)rownum
- index of row to update (0-based)
(rownum - 要更新的行索引(从 0 开始))
level
- outline level (greater than 0)
(level - 大纲级别(大于 0))
public void ungroupRow(int fromRow, int toRow)
ungroupRow
in interface
Sheet
(界面表中的 ungroupRow)
fromRow
- start row (0-based)
(fromRow - 起始行(从 0 开始))
toRow
- end row (0-based)
(toRow - 结束行(从 0 开始))
public void setRowGroupCollapsed(int row, boolean collapse)
setRowGroupCollapsed
in interface
Sheet
(界面Sheet中的setRowGroupCollapsed)
row
- start row of a groupped range of rows (0-based)
(row - 一组行的起始行(从 0 开始))
collapse
- whether to expand/collapse the detail rows
(折叠 - 是否展开/折叠详细信息行)
java.lang.RuntimeException
- if collapse is false as this is not implemented for SXSSF.
(java.lang.RuntimeException - 如果 collapse 为假,因为这不是为 SXSSF 实现的。)
public void setDefaultColumnStyle(int column, CellStyle style)
setDefaultColumnStyle
in interface
Sheet
(界面表中的 setDefaultColumnStyle)
column
- the column index
(column - 列索引)
style
- the style to set
(style - 要设置的样式)
public void trackColumnForAutoSizing(int column)
column
is already tracked, this call does nothing.
(跟踪工作表中的列以自动调整大小。请注意,如果在将一行或多行写入工作表后跟踪列,则此行为未定义。如果已跟踪列,则此调用不执行任何操作。)
column
- the column to track for auto-sizing
(column - 跟踪自动调整大小的列)
trackColumnsForAutoSizing(Collection)
,
trackAllColumnsForAutoSizing()
public void trackColumnsForAutoSizing(java.util.Collection<java.lang.Integer> columns)
columns
that are already tracked are ignored by this call.
(跟踪工作表中的几列以自动调整大小。请注意,如果在将一行或多行写入工作表后跟踪列,则此行为未定义。此调用将忽略已跟踪的列中的任何列。)
columns
- the columns to track for auto-sizing
(columns - 跟踪自动调整大小的列)
public void trackAllColumnsForAutoSizing()
public boolean untrackColumnForAutoSizing(int column)
column
is not tracked, it will be ignored by this call.
(删除以前标记为包含在自动大小列跟踪中的列。当一列未被跟踪时,最适合的宽度被遗忘。如果未跟踪列,则此调用将忽略该列。)
column
- the index of the column to track for auto-sizing
(column - 为自动调整大小而跟踪的列的索引)
untrackColumnsForAutoSizing(Collection)
,
untrackAllColumnsForAutoSizing()
public boolean untrackColumnsForAutoSizing(java.util.Collection<java.lang.Integer> columns)
columns
that is not tracked will be ignored by this call.
(取消跟踪工作表中的几列以自动调整大小。当一列未被跟踪时,最适合的宽度被遗忘。此调用将忽略列中未跟踪的任何列。)
columns
- the indices of the columns to track for auto-sizing
(columns - 为自动调整大小而跟踪的列的索引)
public void untrackAllColumnsForAutoSizing()
public boolean isColumnTrackedForAutoSizing(int column)
column
- the index of the column to check
(column - 要检查的列的索引)
public java.util.Set<java.lang.Integer> getTrackedColumnsForAutoSizing()
public void autoSizeColumn(int column)
This process can be relatively slow on large sheets, so this should normally only be called once per column, at the end of your processing.
You can specify whether the content of merged cells should be considered or ignored. Default is to ignore merged cells. Special note about SXSSF implementation: You must register the columns you wish to track with the SXSSFSheet using trackColumnForAutoSizing(int)
or trackAllColumnsForAutoSizing()
. This is needed because the rows needed to compute the column width may have fallen outside the random access window and been flushed to disk. Tracking columns is required even if all rows are in the random access window.
New in POI 3.14 beta 1: auto-sizes columns using cells from current and flushed rows.
(调整列宽以适合内容。此过程在大型工作表上可能相对较慢,因此通常在处理结束时每列只调用一次。您可以指定是否应考虑或忽略合并单元格的内容。默认是忽略合并的单元格。关于 SXSSF 实现的特别说明:您必须使用 trackColumnForAutoSizing(int) 或 trackAllColumnsForAutoSizing() 注册您希望使用 SXSSFSheet 跟踪的列。这是必需的,因为计算列宽所需的行可能已超出随机访问窗口并已刷新到磁盘。即使所有行都在随机访问窗口中,也需要跟踪列。 POI 3.14 beta 1 中的新功能:使用当前行和刷新行中的单元格自动调整列大小。)autoSizeColumn
in interface
Sheet
(接口表中的 autoSizeColumn)
column
- the column index to auto-size
(column - 要自动调整大小的列索引)
public void autoSizeColumn(int column, boolean useMergedCells)
This process can be relatively slow on large sheets, so this should normally only be called once per column, at the end of your processing.
You can specify whether the content of merged cells should be considered or ignored. Default is to ignore merged cells. Special note about SXSSF implementation: You must register the columns you wish to track with the SXSSFSheet using trackColumnForAutoSizing(int)
or trackAllColumnsForAutoSizing()
. This is needed because the rows needed to compute the column width may have fallen outside the random access window and been flushed to disk. Tracking columns is required even if all rows are in the random access window.
New in POI 3.14 beta 1: auto-sizes columns using cells from current and flushed rows.
(调整列宽以适合内容。此过程在大型工作表上可能相对较慢,因此通常在处理结束时每列只调用一次。您可以指定是否应考虑或忽略合并单元格的内容。默认是忽略合并的单元格。关于 SXSSF 实现的特别说明:您必须使用 trackColumnForAutoSizing(int) 或 trackAllColumnsForAutoSizing() 注册您希望使用 SXSSFSheet 跟踪的列。这是必需的,因为计算列宽所需的行可能已超出随机访问窗口并已刷新到磁盘。即使所有行都在随机访问窗口中,也需要跟踪列。 POI 3.14 beta 1 中的新功能:使用当前行和刷新行中的单元格自动调整列大小。)autoSizeColumn
in interface
Sheet
(接口表中的 autoSizeColumn)
column
- the column index to auto-size
(column - 要自动调整大小的列索引)
useMergedCells
- whether to use the contents of merged cells when calculating the width of the column
(useMergedCells - 计算列宽时是否使用合并单元格的内容)
public XSSFComment getCellComment(CellAddress ref)
getCellComment
in interface
Sheet
(接口表中的getCellComment)
null
if not found
(单元格注释或 null 如果未找到)
public java.util.Map<CellAddress,XSSFComment> getCellComments()
getCellComments
in interface
Sheet
(接口表中的getCellComments)
public XSSFHyperlink getHyperlink(int row, int column)
getHyperlink
in interface
Sheet
(接口表中的getHyperlink)
row
- The 0-base row number
(row - 从 0 开始的行号)
column
- The 0-based column number
(column - 从 0 开始的列号)
public XSSFHyperlink getHyperlink(CellAddress addr)
getHyperlink
in interface
Sheet
(接口表中的getHyperlink)
addr
- The address of the cell containing the hyperlink
(addr - 包含超链接的单元格的地址)
addr
; otherwise returns
null
(超链接,如果有一个超链接锚定在 addr;否则返回 null)
public java.util.List<XSSFHyperlink> getHyperlinkList()
getHyperlinkList
in interface
Sheet
(接口Sheet中的getHyperlinkList)
public XSSFDrawing getDrawingPatriarch()
Sheet.createDrawingPatriarch()
to get or create
(返回工作表的现有绘图,如果还没有,则返回 null。使用 Sheet.createDrawingPatriarch() 获取或创建)
getDrawingPatriarch
in interface
Sheet
(界面Sheet中的getDrawingPatriarch)
public SXSSFDrawing createDrawingPatriarch()
createDrawingPatriarch
in interface
Sheet
(界面Sheet中的createDrawingPatriarch)
public SXSSFWorkbook getWorkbook()
getWorkbook
in interface
Sheet
(接口表中的getWorkbook)
public java.lang.String getSheetName()
getSheetName
in interface
Sheet
(接口Sheet中的getSheetName)
public boolean isSelected()
isSelected
in interface
Sheet
(界面Sheet中的isSelected)
true
if this sheet is currently selected
(如果当前选择了此工作表,则为 true)
public CellRange<? extends Cell> setArrayFormula(java.lang.String formula, CellRangeAddress range)
setArrayFormula
in interface
Sheet
(接口表中的 setArrayFormula)
formula
- text representation of the formula
(公式 - 公式的文本表示)
range
- Region of array formula for result.
(range - 结果的数组公式区域。)
CellRange
of cells affected by this change
(受此更改影响的单元格的 CellRange)
public CellRange<? extends Cell> removeArrayFormula(Cell cell)
removeArrayFormula
in interface
Sheet
(接口表中的 removeArrayFormula)
cell
- any cell within Array Formula range
(单元格 - 数组公式范围内的任何单元格)
CellRange
of cells affected by this change
(受此更改影响的单元格的 CellRange)
public DataValidationHelper getDataValidationHelper()
getDataValidationHelper
in interface
Sheet
(接口表中的 getDataValidationHelper)
public java.util.List<XSSFDataValidation> getDataValidations()
Sheet
getDataValidations
in interface
Sheet
(接口表中的 getDataValidations)
public void addValidationData(DataValidation dataValidation)
addValidationData
in interface
Sheet
(接口表中的 addValidationData)
dataValidation
- The Data validation object settings
(dataValidation - 数据验证对象设置)
public AutoFilter setAutoFilter(CellRangeAddress range)
setAutoFilter
in interface
Sheet
(界面Sheet中的setAutoFilter)
range
- the range of cells to filter
(range - 要过滤的单元格范围)
public SheetConditionalFormatting getSheetConditionalFormatting()
Sheet
getSheetConditionalFormatting
in interface
Sheet
(接口Sheet中的getSheetConditionalFormatting)
public CellRangeAddress getRepeatingRows()
Sheet
Repeating rows cover a range of contiguous rows, e.g.:
Sheet1!$1:$1 Sheet2!$5:$8The
CellRangeAddress
returned contains a column part which spans all columns, and a row part which specifies the contiguous range of repeating rows.
If the Sheet does not have any repeating rows defined, null is returned.
(获取打印工作表时使用的重复行,如 File->PageSetup->Sheet 中所示。重复行覆盖一系列连续行,例如: Sheet1!$1:$1 Sheet2!$5:$8 返回的 CellRangeAddress 包含一个跨所有列的列部分和一个指定重复行的连续范围的行部分。如果工作表没有定义任何重复行,则返回 null。)getRepeatingRows
in interface
Sheet
(接口表中的 getRepeatingRows)
CellRangeAddress
containing the repeating rows for the Sheet, or null.
(包含工作表的重复行的 CellRangeAddress,或 null。)
public CellRangeAddress getRepeatingColumns()
Sheet
Repeating columns cover a range of contiguous columns, e.g.:
Sheet1!$A:$A Sheet2!$C:$FThe
CellRangeAddress
returned contains a row part which spans all rows, and a column part which specifies the contiguous range of repeating columns.
If the Sheet does not have any repeating columns defined, null is returned.
(获取打印工作表时使用的重复列,如 File->PageSetup->Sheet 中所示。重复列覆盖一系列连续列,例如: Sheet1!$A:$A Sheet2!$C:$F 返回的 CellRangeAddress 包含一个跨所有行的行部分和一个指定重复列的连续范围的列部分。如果工作表没有定义任何重复的列,则返回 null。)getRepeatingColumns
in interface
Sheet
(接口表中的 getRepeatingColumns)
CellRangeAddress
containing the repeating columns for the Sheet, or null.
(包含工作表的重复列的 CellRangeAddress,或 null。)
public void setRepeatingRows(CellRangeAddress rowRangeRef)
Sheet
Repeating rows cover a range of contiguous rows, e.g.:
Sheet1!$1:$1 Sheet2!$5:$8The parameter
CellRangeAddress
should specify a column part which spans all columns, and a row part which specifies the contiguous range of repeating rows, e.g.:
sheet.setRepeatingRows(CellRangeAddress.valueOf("2:3"));A null parameter value indicates that repeating rows should be removed from the Sheet:
sheet.setRepeatingRows(null);(设置打印工作表时使用的重复行,如 File->PageSetup->Sheet 中所示。重复行覆盖一系列连续行,例如:Sheet1!$1:$1 Sheet2!$5:$8 参数 CellRangeAddress 应指定跨越所有列的列部分,以及指定重复行的连续范围的行部分,例如:sheet .setRepeatingRows(CellRangeAddress.valueOf("2:3"));空参数值表示应从工作表中删除重复行: sheet.setRepeatingRows(null);)
setRepeatingRows
in interface
Sheet
(接口表中的 setRepeatingRows)
rowRangeRef
- a
CellRangeAddress
containing the repeating rows for the Sheet, or null.
(rowRangeRef - 包含工作表的重复行的 CellRangeAddress,或 null。)
public void setRepeatingColumns(CellRangeAddress columnRangeRef)
Sheet
Repeating columns cover a range of contiguous columns, e.g.:
Sheet1!$A:$A Sheet2!$C:$FThe parameter
CellRangeAddress
should specify a row part which spans all rows, and a column part which specifies the contiguous range of repeating columns, e.g.:
sheet.setRepeatingColumns(CellRangeAddress.valueOf("B:C"));A null parameter value indicates that repeating columns should be removed from the Sheet:
sheet.setRepeatingColumns(null);(设置打印工作表时使用的重复列,如 File->PageSetup->Sheet 中所示。重复列覆盖一系列连续列,例如: Sheet1!$A:$A Sheet2!$C:$F 参数 CellRangeAddress 应指定跨越所有行的行部分,以及指定重复列的连续范围的列部分,例如: sheet.setRepeatingColumns(CellRangeAddress.valueOf("B:C"));空参数值表示应从工作表中删除重复列: sheet.setRepeatingColumns(null);)
setRepeatingColumns
in interface
Sheet
(界面表中的 setRepeatingColumns)
columnRangeRef
- a
CellRangeAddress
containing the repeating columns for the Sheet, or null.
(columnRangeRef - 包含工作表的重复列的 CellRangeAddress,或 null。)
public void setRandomAccessWindowSize(int value)
public boolean areAllRowsFlushed()
public int getLastFlushedRowNum()
public void flushRows(int remaining) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public void flushRows() throws java.io.IOException
java.io.IOException
- If an I/O error occurs
(java.io.IOException - 如果发生 I/O 错误)
public void changeRowNum(SXSSFRow row, int newRowNum)
public int getRowNum(SXSSFRow row)
public int getColumnOutlineLevel(int columnIndex)
Sheet
getColumnOutlineLevel
in interface
Sheet
(接口表中的getColumnOutlineLevel)
public CellAddress getActiveCell()
A1
.
(返回活动单元格的位置,例如 A1。)
getActiveCell
in interface
Sheet
(接口表中的getActiveCell)
public void setActiveCell(CellAddress address)
setActiveCell
in interface
Sheet
(接口表中的 setActiveCell)
address
- the location of the active cell, e.g.
A1
.
(地址 - 活动单元的位置,例如 A1。)
public XSSFColor getTabColor()
public void setTabColor(XSSFColor color)
public void enableLocking()
public void disableLocking()
public void lockAutoFilter(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用自动过滤器锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockDeleteColumns(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用删除列锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockDeleteRows(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用删除行锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockFormatCells(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用格式化单元格锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockFormatColumns(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用格式化列锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockFormatRows(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用格式化行锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockInsertColumns(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用插入列锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockInsertHyperlinks(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用插入超链接锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockInsertRows(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用插入行锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockPivotTables(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用数据透视表锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockSort(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用排序锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockObjects(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用对象锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockScenarios(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用方案锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockSelectLockedCells(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用锁定单元格锁定的选择。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void lockSelectUnlockedCells(boolean enabled)
disableLocking()
or
enableLocking()
(启用或禁用选择未锁定的单元格锁定。这不会修改工作表保护状态。要强制执行此解锁/锁定,请调用 disableLocking() 或 enableLocking())
public void setTabColor(int colorIndex)
colorIndex
- the indexed color to set, must be a constant from
IndexedColors
(colorIndex - 要设置的索引颜色,必须是 IndexedColors 中的常量)
@NotImplemented public void shiftColumns(int startColumn, int endColumn, int n)
Sheet
shiftColumns
in interface
Sheet
(界面工作表中的 shiftColumns)
startColumn
- the column to start shifting
(startColumn - 开始移动的列)
endColumn
- the column to end shifting
(endColumn - 结束移位的列)
n
- the number of columns to shift
(n - 要移动的列数)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.