public class XSSFSheet extends POIXMLDocumentPart implements Sheet
Sheets are the central structures within a workbook, and are where a user does most of his spreadsheet work. The most common type of sheet is the worksheet, which is represented as a grid of cells. Worksheet cells can contain text, numbers, dates, and formulas. Cells can also be formatted.
(SpreadsheetML 工作表的高级表示。工作表是工作簿中的中心结构,是用户进行大部分电子表格工作的地方。最常见的工作表类型是工作表,它表示为单元格网格。工作表单元格可以包含文本、数字、日期和公式。单元格也可以被格式化。)POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet |
sheet |
static int |
TWIPS_PER_POINT
Deprecated.
POI 5.0.0
(已弃用。兴趣点 5.0.0)
|
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet |
worksheet |
BottomMargin, FooterMargin, HeaderMargin, LeftMargin, PANE_LOWER_LEFT, PANE_LOWER_RIGHT, PANE_UPPER_LEFT, PANE_UPPER_RIGHT, RightMargin, TopMargin
Modifier | Constructor and Description |
---|---|
protected |
XSSFSheet()
Creates new XSSFSheet - called by XSSFWorkbook to create a sheet from scratch.
(创建新的 XSSFSheet - 由 XSSFWorkbook 调用以从头开始创建工作表。)
|
protected |
XSSFSheet(PackagePart part)
Creates an XSSFSheet representing the given package part and relationship.
(创建一个表示给定包部分和关系的 XSSFSheet。)
|
Modifier and Type | Method and Description |
---|---|
void |
addHyperlink(XSSFHyperlink hyperlink)
Register a hyperlink in the collection of hyperlinks on this sheet
(在此工作表上的超链接集合中注册一个超链接)
|
void |
addIgnoredErrors(CellRangeAddress region, IgnoredErrorType... ignoredErrorTypes)
Ignore errors across a range of cells.
(忽略一系列单元格中的错误。)
|
void |
addIgnoredErrors(CellReference cell, IgnoredErrorType... ignoredErrorTypes)
Add ignored errors (usually to suppress them in the UI of a consuming application).
(添加被忽略的错误(通常是在使用应用程序的 UI 中抑制它们)。)
|
int |
addMergedRegion(CellRangeAddress region)
Adds a merged region of cells on a sheet.
(在工作表上添加单元格的合并区域。)
|
int |
addMergedRegionUnsafe(CellRangeAddress region)
Adds a merged region of cells (hence those cells form one).
(添加单元格的合并区域(因此这些单元格形成一个)。)
|
void |
addValidationData(DataValidation dataValidation)
Creates a data validation object
(创建数据验证对象)
|
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.
(调整列宽以适合内容。)
|
protected void |
commit()
Save the content in the underlying package part.
(将内容保存在底层包部分中。)
|
void |
copyRows(int srcStartRow, int srcEndRow, int destStartRow, CellCopyPolicy cellCopyPolicy)
Copies rows between srcStartRow and srcEndRow to the same sheet, starting at destStartRow Convenience function for
copyRows(List, int, CellCopyPolicy) Equivalent to copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy)
(将 srcStartRow 和 srcEndRow 之间的行复制到同一个工作表,从 destStartRow 开始 copyRows(List, int, CellCopyPolicy) 的便捷函数 等效于 copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy))
|
void |
copyRows(java.util.List<? extends Row> srcRows, int destStartRow, CellCopyPolicy policy)
copyRows rows from srcRows to this sheet starting at destStartRow Additionally copies merged regions that are completely defined in these rows (ie.
(copyRows 行从 srcRows 到此工作表,从 destStartRow 开始另外复制在这些行中完全定义的合并区域(即。)
|
XSSFDrawing |
createDrawingPatriarch()
Create a new SpreadsheetML drawing.
(创建一个新的 SpreadsheetML 绘图。)
|
void |
createFreezePane(int colSplit, int rowSplit)
Creates a split (freezepane).
(创建一个拆分(冻结窗格)。)
|
void |
createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
Creates a split (freezepane).
(创建一个拆分(冻结窗格)。)
|
XSSFPivotTable |
createPivotTable(AreaReference source, CellReference position)
Create a pivot table using the AreaReference range, at the given position.
(在给定位置使用 AreaReference 范围创建数据透视表。)
|
XSSFPivotTable |
createPivotTable(AreaReference source, CellReference position, Sheet sourceSheet)
Create a pivot table using the AreaReference range on sourceSheet, at the given position.
(在给定位置使用 sourceSheet 上的 AreaReference 范围创建数据透视表。)
|
XSSFPivotTable |
createPivotTable(Name source, CellReference position)
Create a pivot table using the Name range, at the given position.
(在给定位置使用名称范围创建数据透视表。)
|
XSSFPivotTable |
createPivotTable(Name source, CellReference position, Sheet sourceSheet)
Create a pivot table using the Name range reference on sourceSheet, at the given position.
(在给定位置使用 sourceSheet 上的名称范围引用创建数据透视表。)
|
XSSFPivotTable |
createPivotTable(Table source, CellReference position)
Create a pivot table using the Table, at the given position.
(在给定位置使用表格创建数据透视表。)
|
XSSFRow |
createRow(int rownum)
Create a new row within the sheet and return the high level representation Note: If a row already exists at this position, it is removed/overwritten and any existing cell is removed!
(在工作表中创建一个新行并返回高级表示 注意:如果该位置已存在一行,则将其删除/覆盖并删除任何现有单元格!)
|
void |
createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
Creates a split pane.
(创建一个拆分窗格。)
|
XSSFTable |
createTable(AreaReference tableArea)
Creates a new Table, and associates it with this Sheet.
(创建一个新表,并将其与此工作表关联。)
|
void |
disableLocking()
Disable sheet protection
(禁用工作表保护)
|
void |
enableLocking()
Enable sheet protection
(启用工作表保护)
|
int |
findEndOfRowOutlineGroup(int row) |
CellAddress |
getActiveCell()
Return location of the active cell, e.g.
(返回活动小区的位置,例如)
|
boolean |
getAutobreaks()
Flag indicating whether the sheet displays Automatic Page Breaks.
(指示工作表是否显示自动分页符的标志。)
|
XSSFComment |
getCellComment(CellAddress address)
Return cell comment at row, column, if one exists.
(如果存在,则返回行、列的单元格注释。)
|
java.util.Map<CellAddress,XSSFComment> |
getCellComments()
Returns all cell comments on this sheet.
(返回此工作表上的所有单元格注释。)
|
int[] |
getColumnBreaks()
Vertical page break information used for print layout view, page layout view, drawing print breaks in normal view, and for printing the worksheet.
(用于打印布局视图、页面布局视图、普通视图中的绘图打印中断以及打印工作表的垂直分页符信息。)
|
ColumnHelper |
getColumnHelper() |
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 actual column width (in units of 1/256th of a character width )
(获取实际的列宽(以字符宽度的 1/256 为单位))
|
float |
getColumnWidthInPixels(int columnIndex)
Get the actual column width in pixels
(获取以像素为单位的实际列宽)
|
protected CommentsTable |
getCommentsTable(boolean create)
Returns the sheet's comments object if there is one, or null if not
(如果有则返回工作表的评论对象,如果没有则返回 null)
|
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDrawing |
getCTDrawing() |
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLegacyDrawing |
getCTLegacyDrawing() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet |
getCTWorksheet()
Provide access to the CTWorksheet bean holding this sheet's data
(提供对保存此工作表数据的 CTWorksheet bean 的访问)
|
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 measued in point size (if the rows do not define their own height).
(获取以磅为单位测量的工作表的默认行高(如果行没有定义自己的高度)。)
|
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。)
|
Footer |
getEvenFooter()
Returns the even footer.
(返回偶数页脚。)
|
Header |
getEvenHeader()
Returns the even header.
(返回偶数标头。)
|
Footer |
getFirstFooter()
Returns the first page footer.
(返回首页页脚。)
|
Header |
getFirstHeader()
Returns the first page header.
(返回第一页标题。)
|
int |
getFirstRowNum()
Gets the first row on the sheet
(获取工作表的第一行)
|
boolean |
getFitToPage()
Flag indicating whether the Fit to Page print option is enabled.
(指示是否启用适合页面打印选项的标志。)
|
Footer |
getFooter()
Returns the default footer for the sheet, creating one as needed.
(返回工作表的默认页脚,根据需要创建一个。)
|
boolean |
getForceFormulaRecalculation()
Whether Excel will be asked to recalculate all formulas of this sheet when the workbook is opened.
(打开工作簿时是否会要求 Excel 重新计算此工作表的所有公式。)
|
Header |
getHeader()
Returns the default header for the sheet, creating one as needed.
(返回工作表的默认标题,根据需要创建一个。)
|
XSSFHeaderFooterProperties |
getHeaderFooterProperties() |
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
(获取此工作表中的超链接列表)
|
java.util.Map<IgnoredErrorType,java.util.Set<CellRangeAddress>> |
getIgnoredErrors()
Returns the errors currently being ignored and the ranges where they are ignored.
(返回当前被忽略的错误以及它们被忽略的范围。)
|
int |
getLastRowNum()
Gets the last row on the sheet Note: rows which had content before and were set to empty later might still be counted as rows by Excel and Apache POI, so the result of this method will include such rows and thus the returned value might be higher than expected!
(获取工作表上的最后一行 注意:之前有内容并稍后设置为空的行可能仍被 Excel 和 Apache POI 计为行,因此此方法的结果将包含此类行,因此返回值可能更高超出预期!)
|
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.
(返回合并区域的列表。)
|
protected int |
getNumberOfComments() |
int |
getNumHyperlinks() |
int |
getNumMergedRegions()
Returns the number of merged regions defined in this worksheet
(返回此工作表中定义的合并区域数)
|
Footer |
getOddFooter()
Returns the odd footer.
(返回奇数页脚。)
|
Header |
getOddHeader()
Returns the odd header.
(返回奇数标头。)
|
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)
(返回物理定义的行数(不是工作表中的行数))
|
java.util.List<XSSFPivotTable> |
getPivotTables()
Returns all the pivot tables for this Sheet
(返回此工作表的所有数据透视表)
|
XSSFPrintSetup |
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 中所示。)
|
XSSFRow |
getRow(int rownum)
Returns the logical row ( 0-based).
(返回逻辑行(从 0 开始)。)
|
int[] |
getRowBreaks()
Horizontal page break information used for print layout view, page layout view, drawing print breaks in normal view, and for printing the worksheet.
(用于打印布局视图、页面布局视图、普通视图中的绘图打印中断以及打印工作表的水平分页符信息。)
|
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()
A flag indicating whether scenarios are locked when the sheet is protected.
(指示当工作表受到保护时场景是否被锁定的标志。)
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula |
getSharedFormula(int sid)
Return a master shared formula by index
(按索引返回主共享公式)
|
XSSFSheetConditionalFormatting |
getSheetConditionalFormatting()
The 'Conditional Formatting' facet for this
Sheet
(此工作表的“条件格式”方面)
|
java.lang.String |
getSheetName()
Returns the name of this sheet
(返回此工作表的名称)
|
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetViews |
getSheetTypeSheetViews(boolean create) |
XSSFColor |
getTabColor()
Get background color of the sheet tab.
(获取工作表选项卡的背景颜色。)
|
java.util.List<XSSFTable> |
getTables()
Returns any tables associated with this Sheet
(返回与此工作表关联的任何表)
|
short |
getTopRow()
The top row in the visible view when the sheet is first viewed after opening it in a viewer
(在查看器中打开工作表后首次查看工作表时可见视图中的顶行)
|
boolean |
getVerticallyCenter()
Determine whether printed output for this sheet will be vertically centered.
(确定此工作表的打印输出是否垂直居中。)
|
protected XSSFVMLDrawing |
getVMLDrawing(boolean autoCreate)
Get VML drawing for this sheet (aka 'legacy' drawig)
(获取此工作表的 VML 绘图(又名“旧版”绘图))
|
XSSFWorkbook |
getWorkbook()
Returns the parent XSSFWorkbook
(返回父 XSSFWorkbook)
|
void |
groupColumn(int fromColumn, int toColumn)
Group between (0 based) columns
(在(基于 0)列之间分组)
|
void |
groupRow(int fromRow, int toRow)
Tie a range of cell together so that they can be collapsed or expanded
(将一系列单元格连接在一起,以便它们可以折叠或展开)
|
boolean |
hasComments()
Does this sheet have any comments on it? We need to know, so we can decide about writing it to disk or not
(这张表有什么意见吗?我们需要知道,所以我们可以决定是否将其写入磁盘)
|
boolean |
isAutoFilterLocked() |
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 |
isDeleteColumnsLocked() |
boolean |
isDeleteRowsLocked() |
boolean |
isDisplayFormulas()
Gets the flag indicating whether this sheet should display formulas.
(获取指示此工作表是否应显示公式的标志。)
|
boolean |
isDisplayGridlines()
Gets the flag indicating whether this sheet displays the lines between rows and columns to make editing and reading easier.
(获取指示此工作表是否显示行和列之间的线条以使编辑和阅读更容易的标志。)
|
boolean |
isDisplayRowColHeadings()
Gets the flag indicating whether this sheet should display row and column headings.
(获取指示此工作表是否应显示行标题和列标题的标志。)
|
boolean |
isDisplayZeros()
Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.
(获取指示窗口是否应在包含零值的单元格中显示 0(零)的标志。)
|
boolean |
isFormatCellsLocked() |
boolean |
isFormatColumnsLocked() |
boolean |
isFormatRowsLocked() |
boolean |
isInsertColumnsLocked() |
boolean |
isInsertHyperlinksLocked() |
boolean |
isInsertRowsLocked() |
boolean |
isObjectsLocked() |
boolean |
isPivotTablesLocked() |
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)
Tests if there is a page break at the indicated row
(测试指定行是否有分页符)
|
boolean |
isScenariosLocked() |
boolean |
isSelected()
Returns a flag indicating whether this sheet is selected.
(返回一个标志,指示是否选择了此工作表。)
|
boolean |
isSelectLockedCellsLocked() |
boolean |
isSelectUnlockedCellsLocked() |
boolean |
isSheetLocked() |
boolean |
isSortLocked() |
java.util.Iterator<Row> |
iterator()
Alias for
rowIterator() to allow foreach loops
(rowIterator() 的别名以允许 foreach 循环)
|
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.
(启用或禁用排序锁定。)
|
protected void |
onDeleteFormula(XSSFCell cell, BaseXSSFEvaluationWorkbook evalWb)
when a cell with a 'master' shared formula is removed, the next cell in the range becomes the master
(删除具有“主”共享公式的单元格时,该区域中的下一个单元格将成为主单元格)
|
protected void |
onDocumentCreate()
Initialize worksheet data when creating a new sheet.
(创建新工作表时初始化工作表数据。)
|
protected void |
onDocumentRead()
Initialize worksheet data when reading in an exisiting file.
(读取现有文件时初始化工作表数据。)
|
protected void |
onSheetDelete()
called when a sheet is being deleted/removed from a workbook, to clean up relations and other document pieces tied to the sheet
(当从工作簿中删除/删除工作表时调用,以清理与工作表相关的关系和其他文档片段)
|
void |
protectSheet(java.lang.String password)
Enables sheet protection and sets the password for the sheet.
(启用工作表保护并为工作表设置密码。)
|
protected void |
read(java.io.InputStream is) |
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTOleObject |
readOleObject(long shapeId)
Determine the OleObject which links shapes with embedded resources
(确定将形状与嵌入资源链接的 OleObject)
|
CellRange<XSSFCell> |
removeArrayFormula(Cell cell)
Remove a Array Formula from this sheet.
(从此工作表中删除一个数组公式。)
|
void |
removeColumnBreak(int column)
Removes a page break at the indicated column
(删除指定列的分页符)
|
void |
removeHyperlink(int row, int column)
Removes a hyperlink in the collection of hyperlinks on this sheet
(删除此工作表上的超链接集合中的超链接)
|
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 number of merged regions of cells (hence letting them free) This method can be used to bulk-remove merged regions in a way much faster than calling removeMergedRegion() for every single merged region.
(删除许多合并的单元格区域(因此让它们自由) 此方法可用于以比为每个合并区域调用 removeMergedRegion() 更快的方式批量删除合并区域。)
|
void |
removeRow(Row row)
Remove a row from this sheet.
(从此工作表中删除一行。)
|
void |
removeRowBreak(int row)
Removes the page break at the indicated row
(删除指定行的分页符)
|
void |
removeTable(XSSFTable t)
Remove table references and relations
(删除表引用和关系)
|
java.util.Iterator<Row> |
rowIterator()
Returns an iterator of the physical rows
(返回物理行的迭代器)
|
void |
setActiveCell(CellAddress address)
Sets location of the active cell
(设置活动单元格的位置)
|
CellRange<XSSFCell> |
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.
(指示工作表是否显示自动分页符的标志。)
|
XSSFAutoFilter |
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)
Specifies the number of characters of the maximum digit width of the normal style's font.
(指定普通样式字体的最大数字宽度的字符数。)
|
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)
Sets default row height measured in point size.
(设置以磅为单位测量的默认行高。)
|
void |
setDisplayFormulas(boolean show)
Sets the flag indicating whether this sheet should display formulas.
(设置指示此工作表是否应显示公式的标志。)
|
void |
setDisplayGridlines(boolean show)
Sets the flag indicating whether this sheet should display the lines between rows and columns to make editing and reading easier.
(设置标志,指示此工作表是否应显示行和列之间的线条以使编辑和阅读更容易。)
|
void |
setDisplayGuts(boolean value)
Set whether to display the guts or not
(设置是否显示胆量)
|
void |
setDisplayRowColHeadings(boolean show)
Sets the flag indicating whether this sheet should display row and column headings.
(设置指示此工作表是否应显示行和列标题的标志。)
|
void |
setDisplayZeros(boolean value)
Set whether the window should show 0 (zero) in cells containing zero value.
(设置窗口是否应在包含零值的单元格中显示 0(零)。)
|
void |
setFitToPage(boolean b)
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 on this sheet when the workbook is opened.
(控制打开工作簿时是否应要求 Excel 重新计算此工作表上的所有公式。)
|
void |
setHorizontallyCenter(boolean value)
Center on page horizontally when printing.
(打印时水平居中页面。)
|
void |
setMargin(short margin, double size)
Sets the size of the margin in inches.
(以英寸为单位设置边距的大小。)
|
void |
setPrintGridlines(boolean value)
Turns on or off the printing of gridlines.
(打开或关闭网格线的打印。)
|
void |
setPrintRowAndColumnHeadings(boolean value)
Turns on or off the printing of row and column headings.
(打开或关闭行和列标题的打印。)
|
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 Breaks occur above the specified row and left of the specified column inclusive.
(在指示的行处设置分页符 分页符发生在指定行的上方和指定列的左侧(含)。)
|
void |
setRowGroupCollapsed(int rowIndex, boolean collapse)
group the row It is possible for collapsed to be false and yet still have the rows in question hidden.
(对行进行分组 折叠可能为假,但仍隐藏有问题的行。)
|
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 |
setSheetPassword(java.lang.String password, HashAlgorithm hashAlgo)
Sets the sheet password.
(设置工作表密码。)
|
void |
setTabColor(XSSFColor color)
Set background color of the sheet tab
(设置工作表标签的背景颜色)
|
void |
setVerticallyCenter(boolean value)
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)
Shifts rows between startRow and endRow n number of rows.
(在 startRow 和 endRow 之间移动行 n 行。)
|
void |
shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Shifts rows between startRow and endRow n number of rows.
(在 startRow 和 endRow 之间移动行 n 行。)
|
void |
showInPane(int topRow, int leftCol)
Location of the top left visible cell Location of the top left visible cell in the bottom right pane (when in Left-to-Right mode).
(左上可见单元格的位置 右下窗格中左上角可见单元格的位置(在从左到右模式下)。)
|
void |
ungroupColumn(int fromColumn, int toColumn)
Ungroup a range of columns that were previously grouped
(取消组合之前分组的一系列列)
|
void |
ungroupRow(int fromRow, int toRow)
Ungroup a range of rows that were previously groupped
(取消组合之前分组的一系列行)
|
void |
validateMergedRegions()
Verify that merged regions do not intersect multi-cell array formulas and no merged regions intersect another merged region in this sheet.
(验证合并区域不会与多单元格数组公式相交,并且没有合并区域与此工作表中的另一个合并区域相交。)
|
boolean |
validateSheetPassword(java.lang.String password)
Validate the password against the stored hash, the hashing method will be determined by the existing password attributes
(根据存储的哈希验证密码,哈希方法将由现有的密码属性确定)
|
protected void |
write(java.io.OutputStream out) |
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
public static final int TWIPS_PER_POINT
Font.TWIPS_PER_POINT
instead.
(为了向后兼容,请改用 Font.TWIPS_PER_POINT。)
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet sheet
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet worksheet
protected XSSFSheet()
XSSFWorkbook.createSheet()
protected XSSFSheet(PackagePart part)
part
- - The package part that holds xml data representing this sheet.
(part - 包含代表此工作表的 xml 数据的包部分。)
public XSSFWorkbook getWorkbook()
getWorkbook
in interface
Sheet
(接口表中的getWorkbook)
protected void onDocumentRead()
onDocumentRead
in class
POIXMLDocumentPart
protected void read(java.io.InputStream is) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected void onDocumentCreate()
onDocumentCreate
in class
POIXMLDocumentPart
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet getCTWorksheet()
public ColumnHelper getColumnHelper()
public java.lang.String getSheetName()
getSheetName
in interface
Sheet
(接口Sheet中的getSheetName)
public int addMergedRegion(CellRangeAddress region)
addMergedRegion
in interface
Sheet
(界面Sheet中的addMergedRegion)
region
- to merge
(区域 - 合并)
java.lang.IllegalArgumentException
- if region contains fewer than 2 cells
(java.lang.IllegalArgumentException - 如果区域包含少于 2 个单元格)
java.lang.IllegalStateException
- if region intersects with a multi-cell array formula
(java.lang.IllegalStateException - 如果区域与多单元格数组公式相交)
java.lang.IllegalStateException
- if region intersects with an existing region on this sheet
(java.lang.IllegalStateException - 如果区域与此工作表上的现有区域相交)
public int addMergedRegionUnsafe(CellRangeAddress region)
validateMergedRegions()
, which runs in O(n^2) time.
(添加单元格的合并区域(因此这些单元格形成一个)。跳过验证。可以创建重叠的合并区域或创建与此公式相交的多单元格数组公式的合并区域,这可能会导致工作簿损坏。要在调用 addMergedRegionUnsafe 后检查合并区域是否与数组公式重叠或其他合并区域,请调用 validateMergedRegions(),它在 O(n^2) 时间内运行。)
addMergedRegionUnsafe
in interface
Sheet
(接口 Sheet 中的 addMergedRegionUnsafe)
region
- to merge
(区域 - 合并)
java.lang.IllegalArgumentException
- if region contains fewer than 2 cells
(java.lang.IllegalArgumentException - 如果区域包含少于 2 个单元格)
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 autoSizeColumn(int column)
autoSizeColumn
in interface
Sheet
(接口表中的 autoSizeColumn)
column
- the column index
(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. (调整列宽以适合内容。此过程在大型工作表上可能相对较慢,因此通常在处理结束时每列只调用一次。您可以指定是否应考虑或忽略合并单元格的内容。默认是忽略合并的单元格。)autoSizeColumn
in interface
Sheet
(接口表中的 autoSizeColumn)
column
- the column index
(column - 列索引)
useMergedCells
- whether to use the contents of merged cells when calculating the width of the column
(useMergedCells - 计算列宽时是否使用合并单元格的内容)
public XSSFDrawing getDrawingPatriarch()
createDrawingPatriarch()
to get or create
(返回工作表的现有绘图,如果还没有,则返回 null。使用 createDrawingPatriarch() 获取或创建)
getDrawingPatriarch
in interface
Sheet
(界面Sheet中的getDrawingPatriarch)
public XSSFDrawing createDrawingPatriarch()
createDrawingPatriarch
in interface
Sheet
(界面Sheet中的createDrawingPatriarch)
protected XSSFVMLDrawing getVMLDrawing(boolean autoCreate)
autoCreate
- if true, then a new VML drawing part is created
(autoCreate - 如果为真,则创建一个新的 VML 绘图部件)
null
if the drawing was not found and autoCreate=false
(如果未找到绘图并且 autoCreate=false,则 VML 绘图为 null)
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDrawing getCTDrawing()
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLegacyDrawing getCTLegacyDrawing()
public void createFreezePane(int colSplit, int rowSplit)
createFreezePane
in interface
Sheet
(界面Sheet中的createFreezePane)
colSplit
- Horizontal position of split.
(colSplit - 拆分的水平位置。)
rowSplit
- Vertical position of split.
(rowSplit - 拆分的垂直位置。)
public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
If both colSplit and rowSplit are zero then the existing freeze pane is removed
(创建一个拆分(冻结窗格)。任何现有的冻结窗格或拆分窗格都会被覆盖。如果 colSplit 和 rowSplit 都为零,则删除现有的冻结窗格)createFreezePane
in interface
Sheet
(界面Sheet中的createFreezePane)
colSplit
- Horizontal 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 XSSFRow createRow(int rownum)
createRow
in interface
Sheet
(界面Sheet中的createRow)
rownum
- row number
(rownum - 行号)
XSSFRow
object representing a row in the sheet
(表示工作表中一行的高级 XSSFRow 对象)
removeRow(org.apache.poi.ss.usermodel.Row)
public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
createSplitPane
in interface
Sheet
(界面Sheet中的createSplitPane)
xSplitPos
- Horizontal 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 XSSFComment getCellComment(CellAddress address)
getCellComment
in interface
Sheet
(接口表中的getCellComment)
address
- the location of the cell comment
(address - 单元格注释的位置)
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 row where the hyperlink is anchored
(row - 超链接锚定的行)
column
- The column where the hyperlinkn is anchored
(column - 超链接锚定的列)
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 int[] getColumnBreaks()
getColumnBreaks
in interface
Sheet
(接口表中的 getColumnBreaks)
null
(所有垂直分页符的列索引,从不为空)
public int getColumnWidth(int columnIndex)
Note, the returned value is always gerater that getDefaultColumnWidth()
because the latter does not include margins. Actual column width measured as the number of characters of the maximum digit width of the numbers 0, 1, 2, ..., 9 as rendered in the normal style's font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines.
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 int getDefaultColumnWidth()
Note, this value is different from getColumnWidth(int)
. The latter is always greater and includes 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines.
getDefaultColumnWidth
in interface
Sheet
(接口表中的getDefaultColumnWidth)
public short getDefaultRowHeight()
getDefaultRowHeight
in interface
Sheet
(接口表中的getDefaultRowHeight)
public float getDefaultRowHeightInPoints()
getDefaultRowHeightInPoints
in interface
Sheet
(接口表中的 getDefaultRowHeightInPoints)
public CellStyle getColumnStyle(int column)
getColumnStyle
in interface
Sheet
(界面Sheet中的getColumnStyle)
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 boolean getDisplayGuts()
getDisplayGuts
in interface
Sheet
(接口表中的 getDisplayGuts)
public void setDisplayGuts(boolean value)
setDisplayGuts
in interface
Sheet
(界面表中的 setDisplayGuts)
value
- - guts or no guts
(价值 - - 有胆量或没有胆量)
public boolean isDisplayZeros()
isDisplayZeros
in interface
Sheet
(界面表中的 isDisplayZeros)
public void setDisplayZeros(boolean value)
setDisplayZeros
in interface
Sheet
(界面表中的 setDisplayZeros)
value
- whether to display or hide all zero values on the worksheet
(value - 是否在工作表上显示或隐藏所有零值)
public int getFirstRowNum()
getFirstRowNum
in interface
Sheet
(接口表中的 getFirstRowNum)
public boolean getFitToPage()
getFitToPage
in interface
Sheet
(接口表中的getFitToPage)
true
(真的)
public Footer getFooter()
getFirstFooter()
,
getOddFooter()
and
getEvenFooter()
(返回工作表的默认页脚,根据需要创建一个。您可能还想查看 getFirstFooter()、getOddFooter() 和 getEvenFooter())
public Header getHeader()
getFirstHeader()
,
getOddHeader()
and
getEvenHeader()
(返回工作表的默认标题,根据需要创建一个。您可能还想查看 getFirstHeader()、getOddHeader() 和 getEvenHeader())
public Footer getOddFooter()
public Footer getEvenFooter()
public Footer getFirstFooter()
public Header getOddHeader()
public Header getEvenHeader()
public Header getFirstHeader()
public boolean getHorizontallyCenter()
getHorizontallyCenter
in interface
Sheet
(界面表中的getHorizontallyCenter)
public int getLastRowNum()
Sheet
getLastRowNum
in interface
Sheet
(接口表中的 getLastRowNum)
public short getLeftCol()
Sheet
getLeftCol
in interface
Sheet
(接口表中的 getLeftCol)
public double getMargin(short margin)
getMargin
in interface
Sheet
(接口表中的getMargin)
margin
- which margin to get
(保证金 - 要获得的保证金)
Sheet.LeftMargin
,
Sheet.RightMargin
,
Sheet.TopMargin
,
Sheet.BottomMargin
,
Sheet.HeaderMargin
,
Sheet.FooterMargin
public void setMargin(short margin, double size)
setMargin
in interface
Sheet
(界面Sheet中的setMargin)
margin
- which margin to get
(保证金 - 要获得的保证金)
size
- the size of the margin
(size - 边距的大小)
Sheet.LeftMargin
,
Sheet.RightMargin
,
Sheet.TopMargin
,
Sheet.BottomMargin
,
Sheet.HeaderMargin
,
Sheet.FooterMargin
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 int getNumMergedRegions()
getNumMergedRegions
in interface
Sheet
(接口表中的 getNumMergedRegions)
public int getNumHyperlinks()
public PaneInformation getPaneInformation()
getPaneInformation
in interface
Sheet
(界面Sheet中的getPaneInformation)
public int getPhysicalNumberOfRows()
getPhysicalNumberOfRows
in interface
Sheet
(接口表中的 getPhysicalNumberOfRows)
public XSSFPrintSetup getPrintSetup()
getPrintSetup
in interface
Sheet
(接口Sheet中的getPrintSetup)
public boolean getProtect()
getProtect
in interface
Sheet
(接口表中的getProtect)
public void protectSheet(java.lang.String password)
CTSheetProtection
that correspond to the default values used by Excel
(启用工作表保护并为工作表设置密码。还在 CTSheetProtection 上设置一些属性,这些属性对应于 Excel 使用的默认值)
protectSheet
in interface
Sheet
(界面Sheet中的protectSheet)
password
- to set for protection. Pass
null
to remove protection
(密码 - 设置保护。传递 null 以删除保护)
public void setSheetPassword(java.lang.String password, HashAlgorithm hashAlgo)
password
- if null, the password will be removed
(密码 - 如果为空,密码将被删除)
hashAlgo
- if null, the password will be set as XOR password (Excel 2010 and earlier) otherwise the given algorithm is used for calculating the hash password (Excel 2013)
(hashAlgo - 如果为空,密码将设置为 XOR 密码(Excel 2010 及更早版本),否则使用给定算法计算哈希密码(Excel 2013))
public boolean validateSheetPassword(java.lang.String password)
public XSSFRow getRow(int rownum)
public int[] getRowBreaks()
getRowBreaks
in interface
Sheet
(接口表中的 getRowBreaks)
null
(所有水平分页符的行索引,从不为空)
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 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 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 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 getScenarioProtect()
getScenarioProtect
in interface
Sheet
(接口表中的 getScenarioProtect)
public short getTopRow()
public boolean getVerticallyCenter()
getVerticallyCenter
in interface
Sheet
(界面表中的getVerticalCenter)
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 groupRow(int fromRow, int toRow)
public boolean isColumnBroken(int column)
isColumnBroken
in interface
Sheet
(isColumnBroken 在接口表中)
column
- FIXME: Document this!
(专栏 - FIXME:记录这个!)
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 boolean isDisplayFormulas()
isDisplayFormulas
in interface
Sheet
(界面表中的 isDisplayFormulas)
true
if this sheet should display formulas.
(如果此工作表应显示公式,则为 true。)
public boolean isDisplayGridlines()
isDisplayGridlines
in interface
Sheet
(界面表中的 isDisplayGridlines)
true
(default) if this sheet displays gridlines.
(如果此工作表显示网格线,则为 true(默认)。)
to check if printing of gridlines is turned on or off
public void setDisplayGridlines(boolean show)
setPrintGridlines(boolean)
(设置标志,指示此工作表是否应显示行和列之间的线条以使编辑和阅读更容易。要打印网格线,请使用 setPrintGridlines(boolean))
setDisplayGridlines
in interface
Sheet
(界面Sheet中的setDisplayGridlines)
show
-
true
if this sheet should display gridlines.
(show - 如果此工作表应显示网格线,则为 true。)
setPrintGridlines(boolean)
public boolean isDisplayRowColHeadings()
Row heading are the row numbers to the side of the sheet
Column heading are the letters or numbers that appear above the columns of the sheet
(获取指示此工作表是否应显示行标题和列标题的标志。行标题是工作表侧面的行号 列标题是出现在工作表列上方的字母或数字)isDisplayRowColHeadings
in interface
Sheet
(界面表中的 isDisplayRowColHeadings)
true
(default) if this sheet should display row and column headings.
(如果此工作表应显示行和列标题,则为 true(默认)。)
public void setDisplayRowColHeadings(boolean show)
Row heading are the row numbers to the side of the sheet
Column heading are the letters or numbers that appear above the columns of the sheet
(设置指示此工作表是否应显示行和列标题的标志。行标题是工作表侧面的行号 列标题是出现在工作表列上方的字母或数字)setDisplayRowColHeadings
in interface
Sheet
(界面表中的 setDisplayRowColHeadings)
show
-
true
if this sheet should display row and column headings.
(show - 如果此工作表应显示行和列标题,则为 true。)
public boolean isPrintGridlines()
isPrintGridlines
in interface
Sheet
(界面Sheet中的isPrintGridlines)
to check if gridlines are displayed on screen
public void setPrintGridlines(boolean value)
setPrintGridlines
in interface
Sheet
(界面Sheet中的setPrintGridlines)
value
- boolean to turn on or off the printing of gridlines
(value - 打开或关闭网格线打印的布尔值)
to display gridlines on screen
public boolean isPrintRowAndColumnHeadings()
isPrintRowAndColumnHeadings
in interface
Sheet
(界面Sheet中的isPrintRowAndColumnHeadings)
public void setPrintRowAndColumnHeadings(boolean value)
setPrintRowAndColumnHeadings
in interface
Sheet
(界面Sheet中的setPrintRowAndColumnHeadings)
value
- boolean to turn on or off the printing of row and column headings
(value - 布尔值,用于打开或关闭行和列标题的打印)
public boolean isRowBroken(int row)
isRowBroken
in interface
Sheet
(isRowBroken 在接口表中)
row
- index of the row to test
(row - 要测试的行的索引)
true
if there is a page break at the indicated row
(如果在指示的行有分页符,则为 true)
public void setRowBreak(int row)
sheet.setColumnBreak(2);
breaks the sheet into two parts with columns A,B,C in the first and D,E,... in the second. Simuilar,
sheet.setRowBreak(2);
breaks the sheet into two parts with first three rows (rownum=1...3) in the first part and rows starting with rownum=4 in the second.
(在指示的行处设置分页符 分页符发生在指定行的上方和指定列的左侧(含)。例如 sheet.setColumnBreak(2);将工作表分成两部分,第一部分为 A、B、C 列,第二部分为 D、E、...。类似的,sheet.setRowBreak(2);将工作表分成两部分,第一部分为前三行 (rownum=1...3),第二部分为以 rownum=4 开头的行。)
setRowBreak
in interface
Sheet
(接口表中的 setRowBreak)
row
- the row to break, inclusive
(row - 要中断的行,包括)
public void removeColumnBreak(int column)
removeColumnBreak
in interface
Sheet
(界面表中的 removeColumnBreak)
column
- The 0-based index of the column.
(column - 列的从 0 开始的索引。)
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
- A set of the regions to unmerge
(索引 - 一组要取消合并的区域)
public void removeRow(Row row)
public void removeRowBreak(int row)
removeRowBreak
in interface
Sheet
(接口表中的 removeRowBreak)
row
- The 0-based index of the row.
(row - 行的从 0 开始的索引。)
public void setForceFormulaRecalculation(boolean value)
Calculating the formula values with FormulaEvaluator
is the recommended solution, but this may be used for certain cases where evaluation in POI is not possible.
It is recommended to force recalcuation of formulas on workbook level using Workbook.setForceFormulaRecalculation(boolean)
to ensure that all cross-worksheet formuals and external dependencies are updated.
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)
public java.util.Iterator<Row> rowIterator()
Sheet
rowIterator
in interface
Sheet
(界面Sheet中的rowIterator)
public java.util.Iterator<Row> iterator()
rowIterator()
to allow foreach loops
(rowIterator() 的别名以允许 foreach 循环)
iterator
in interface
java.lang.Iterable<Row>
(接口 java.lang.Iterable 中的迭代器
public boolean getAutobreaks()
getAutobreaks
in interface
Sheet
(接口表中的 getAutobreaks)
true
if the sheet displays Automatic Page Breaks.
(如果工作表显示自动分页符,则为 true。)
public void setAutobreaks(boolean value)
setAutobreaks
in interface
Sheet
(界面表中的 setAutobreaks)
value
-
true
if the sheet displays Automatic Page Breaks.
(value - 如果工作表显示自动分页符,则为 true。)
public void setColumnBreak(int column)
sheet.setColumnBreak(2);
breaks the sheet into two parts with columns A,B,C in the first and D,E,... in the second. Simuilar,
sheet.setRowBreak(2);
breaks the sheet into two parts with first three rows (rownum=1...3) in the first part and rows starting with rownum=4 in the second.
(在指示的列处设置分页符。中断发生在指定行的上方和指定列的左侧(含)。例如 sheet.setColumnBreak(2);将工作表分成两部分,第一部分为 A、B、C 列,第二部分为 D、E、...。类似的,sheet.setRowBreak(2);将工作表分成两部分,第一部分为前三行 (rownum=1...3),第二部分为以 rownum=4 开头的行。)
setColumnBreak
in interface
Sheet
(接口表中的 setColumnBreak)
column
- the column to break, inclusive
(column - 要中断的列,包括)
public void setColumnGroupCollapsed(int columnNumber, boolean collapsed)
Sheet
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 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 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 (first font in the workbook).
Character width is defined as the maximum digit width of the numbers 0, 1, 2, ... 9
as rendered using the default font (first font in the workbook).
Unless you are using a very special font, the default character is '0' (zero), this is true for Arial (default font font in HSSF) and Calibri (default font in XSSF)
Please note, that the width set by this method includes 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines (Section 3.3.1.12 of the OOXML spec). This results is a slightly less value of visible characters than passed to this method (approx. 1/2 of a character).
To compute the actual number of visible characters, Excel uses the following formula (Section 3.3.1.12 of the OOXML spec):
width = Truncate([{Number of Visible Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). If you set a column width to be eight characters wide, e.g. setColumnWidth(columnIndex, 8*256)
, then the actual value of visible characters (the value shown in Excel) is derived from the following equation: Truncate([numChars*7+5]/7*256)/256 = 8;
which gives 7.29
.
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 为单位的宽度)
java.lang.IllegalArgumentException
- if width > 255*256 (the maximum column width in Excel is 255 characters)
(java.lang.IllegalArgumentException - 如果宽度 > 255*256(Excel 中的最大列宽为 255 个字符))
public void setDefaultColumnStyle(int column, CellStyle style)
Sheet
setDefaultColumnStyle
in interface
Sheet
(界面表中的 setDefaultColumnStyle)
column
- the column index
(column - 列索引)
style
- the style to set
(style - 要设置的样式)
public void setDefaultColumnWidth(int width)
setDefaultColumnWidth
in interface
Sheet
(界面表中的 setDefaultColumnWidth)
width
- the number of characters. Default value is
8
.
(宽度 - 字符数。默认值为 8。)
public void setDefaultRowHeight(short height)
setDefaultRowHeight
in interface
Sheet
(接口表中的 setDefaultRowHeight)
height
- default row height in twips (1/20 of a point)
(height - 缇的默认行高(1/20 点))
public void setDefaultRowHeightInPoints(float height)
setDefaultRowHeightInPoints
in interface
Sheet
(接口表中的 setDefaultRowHeightInPoints)
height
- default row height measured in point size.
(height - 以磅为单位测量的默认行高。)
public void setDisplayFormulas(boolean show)
setDisplayFormulas
in interface
Sheet
(界面表中的 setDisplayFormulas)
show
-
true
if this sheet should display formulas.
(show - 如果此工作表应显示公式,则为 true。)
public void setFitToPage(boolean b)
setFitToPage
in interface
Sheet
(界面Sheet中的setFitToPage)
b
-
true
if the Fit to Page print option is enabled.
(b - 如果启用了适合页面打印选项,则为 true。)
public void setHorizontallyCenter(boolean value)
setHorizontallyCenter
in interface
Sheet
(界面Sheet中的setHorizontallyCenter)
value
- whether to center on page horizontally when printing.
(value - 打印时是否在页面上水平居中。)
public void setVerticallyCenter(boolean value)
setVerticallyCenter
in interface
Sheet
(界面Sheet中的setVerticallyCenter)
value
- true to vertically center, false otherwise.
(value - 垂直居中为真,否则为假。)
public void setRowGroupCollapsed(int rowIndex, boolean collapse)
setRowGroupCollapsed
in interface
Sheet
(界面Sheet中的setRowGroupCollapsed)
rowIndex
- - the row involved, 0 based
(rowIndex - - 涉及的行,从 0 开始)
collapse
- - boolean value for collapse
(崩溃 - - 崩溃的布尔值)
public int findEndOfRowOutlineGroup(int row)
row
- the zero based row index to find from
(row - 要从中查找的基于零的行索引)
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% 当前视图可以是“普通”、“页面布局”或“分页预览”。)
@Beta public void copyRows(java.util.List<? extends Row> srcRows, int destStartRow, CellCopyPolicy policy)
srcRows
- the rows to copy. Formulas will be offset by the difference in the row number of the first row in srcRows and destStartRow (even if srcRows are from a different sheet).
(srcRows - 要复制的行。公式将被 srcRows 和 destStartRow 中第一行的行号差异抵消(即使 srcRows 来自不同的工作表)。)
destStartRow
- the row in this sheet to paste the first row of srcRows the remainder of srcRows will be pasted below destStartRow per the cell copy policy
(destStartRow - 此工作表中用于粘贴第一行 srcRows 的行,其余 srcRows 将根据单元格复制策略粘贴到 destStartRow 下方)
policy
- is the cell copy policy, which can be used to merge the source and destination when the source is blank, copy styles only, paste as value, etc
(policy - 是单元格复制策略,可用于源为空白时合并源和目标,仅复制样式,粘贴为值等)
@Beta public void copyRows(int srcStartRow, int srcEndRow, int destStartRow, CellCopyPolicy cellCopyPolicy)
copyRows(List, int, CellCopyPolicy)
Equivalent to copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy)
(将 srcStartRow 和 srcEndRow 之间的行复制到同一个工作表,从 destStartRow 开始 copyRows(List, int, CellCopyPolicy) 的便捷函数 等效于 copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy))
srcStartRow
- the index of the first row to copy the cells from in this sheet
(srcStartRow - 要复制此工作表中的单元格的第一行的索引)
srcEndRow
- the index of the last row to copy the cells from in this sheet
(srcEndRow - 要复制此工作表中的单元格的最后一行的索引)
destStartRow
- the index of the first row to copy the cells to in this sheet
(destStartRow - 要将单元格复制到此工作表中的第一行的索引)
cellCopyPolicy
- the policy to use to determine how cells are copied
(cellCopyPolicy - 用于确定如何复制单元格的策略)
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).
(在 startRow 和 endRow 之间移动行 n 行。如果您使用负数,它将向上移动行。代码确保行不会环绕。调用 shiftRows(startRow, endRow, n, false, false);另外移动在这些行中完全定义的合并区域(即,在要移动的行上合并 2 个单元格)。)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.
(在 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 shiftColumns(int startColumn, int endColumn, int n)
shiftColumns
in interface
Sheet
(界面工作表中的 shiftColumns)
startColumn
- the column to start shifting
(startColumn - 开始移动的列)
endColumn
- the column to end shifting
(endColumn - 结束移位的列)
n
- length of the shifting step
(n - 移动步长)
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 ungroupColumn(int fromColumn, int toColumn)
Sheet
ungroupColumn
in interface
Sheet
(界面Sheet中的ungroupColumn)
fromColumn
- start column (0-based)
(fromColumn - 起始列(从 0 开始))
toColumn
- end column (0-based)
(toColumn - 结束列(从 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 开始))
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetViews getSheetTypeSheetViews(boolean create)
public boolean isSelected()
When only 1 sheet is selected and active, this value should be in synch with the activeTab value. In case of a conflict, the Start Part setting wins and sets the active sheet tab.
Note: multiple sheets can be selected, but only one sheet can be active at one time. (返回一个标志,指示是否选择了此工作表。当仅选择并激活 1 张工作表时,此值应与 activeTab 值同步。如果发生冲突,则“开始部分”设置获胜并设置活动工作表选项卡。注意:可以选择多张工作表,但一次只能激活一张工作表。)isSelected
in interface
Sheet
(界面Sheet中的isSelected)
true
if this sheet is selected
(如果选择了此工作表,则为 true)
public void setSelected(boolean value)
When only 1 sheet is selected and active, this value should be in synch with the activeTab value. In case of a conflict, the Start Part setting wins and sets the active sheet tab.
Note: multiple sheets can be selected, but only one sheet can be active at one time. (设置一个标志,指示此工作表是否被选中。当仅选择并激活 1 张工作表时,此值应与 activeTab 值同步。如果发生冲突,则“开始部分”设置获胜并设置活动工作表选项卡。注意:可以选择多张工作表,但一次只能激活一张工作表。)setSelected
in interface
Sheet
(界面Sheet中的setSelected)
value
-
true
if this sheet is selected
(value - 如果选择了此工作表,则为 true)
Workbook.setActiveSheet(int)
@Internal public void addHyperlink(XSSFHyperlink hyperlink)
hyperlink
- the link to add
(超链接 - 要添加的链接)
@Internal public void removeHyperlink(int row, int column)
row
- row index
(行 - 行索引)
column
- column index
(column - 列索引)
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 boolean hasComments()
protected int getNumberOfComments()
protected CommentsTable getCommentsTable(boolean create)
create
- create a new comments table if it does not exist
(create - 如果不存在,则创建一个新的评论表)
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula getSharedFormula(int sid)
sid
- shared group index
(sid - 共享组索引)
null
if not found
(持有共享公式的 CTCellFormula bean,如果未找到则为 null)
protected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); out.close(); }(将内容保存在底层包部分中。默认实现是空的,这意味着包部分保持不变。子类应覆盖并添加逻辑以将“模型”编组到 Ooxml4J。例如,保存通用 XML 条目的代码可能如下所示: protected void commit() throws IOException { PackagePart part = getPackagePart();输出流输出 = part.getOutputStream(); XmlObject bean = getXmlBean(); //保存内存变化的“模型” bean.save(out, DEFAULT_XML_OPTIONS); out.close(); })
commit
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
protected void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public boolean isAutoFilterLocked()
public boolean isDeleteColumnsLocked()
public boolean isDeleteRowsLocked()
public boolean isFormatCellsLocked()
public boolean isFormatColumnsLocked()
public boolean isFormatRowsLocked()
public boolean isInsertColumnsLocked()
public boolean isInsertHyperlinksLocked()
public boolean isInsertRowsLocked()
public boolean isPivotTablesLocked()
public boolean isSortLocked()
public boolean isObjectsLocked()
public boolean isScenariosLocked()
public boolean isSelectLockedCellsLocked()
public boolean isSelectUnlockedCellsLocked()
public boolean isSheetLocked()
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 CellRange<XSSFCell> setArrayFormula(java.lang.String formula, CellRangeAddress range)
Sheet
Note if there are shared formulas this will invalidate any FormulaEvaluator
instances based on this workbook
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<XSSFCell> removeArrayFormula(Cell cell)
Sheet
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)
Sheet
addValidationData
in interface
Sheet
(接口表中的 addValidationData)
dataValidation
- The Data validation object settings
(dataValidation - 数据验证对象设置)
public XSSFAutoFilter setAutoFilter(CellRangeAddress range)
Sheet
setAutoFilter
in interface
Sheet
(界面Sheet中的setAutoFilter)
range
- the range of cells to filter
(range - 要过滤的单元格范围)
public XSSFTable createTable(AreaReference tableArea)
The table is assigned a default display name (since 4.1.1) which can be overridden by calling setDisplayName
. The default display name is guaranteed to not conflict with the names of any XSSFName
or XSSFTable
in the workbook.
tableArea
- the area that the table should cover, should not be null
(tableArea - 表格应覆盖的区域,不应为空)
public java.util.List<XSSFTable> getTables()
public void removeTable(XSSFTable t)
t
- table to remove
(t - 要删除的表)
public XSSFSheetConditionalFormatting getSheetConditionalFormatting()
Sheet
getSheetConditionalFormatting
in interface
Sheet
(接口Sheet中的getSheetConditionalFormatting)
public XSSFColor getTabColor()
public void setTabColor(XSSFColor color)
color
- the color to set
(color - 要设置的颜色)
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。)
@Beta public XSSFPivotTable createPivotTable(AreaReference source, CellReference position, Sheet sourceSheet)
source
- location of pivot data
(源 - 枢轴数据的位置)
position
- A reference to the top left cell where the pivot table will start
(position - 对数据透视表开始的左上角单元格的引用)
sourceSheet
- The sheet containing the source data, if the source reference doesn't contain a sheet name
(sourceSheet - 如果源引用不包含工作表名称,则包含源数据的工作表)
java.lang.IllegalArgumentException
- if source references a sheet different than sourceSheet
(java.lang.IllegalArgumentException - 如果源引用的工作表不同于 sourceSheet)
@Beta public XSSFPivotTable createPivotTable(AreaReference source, CellReference position)
source
- location of pivot data
(源 - 枢轴数据的位置)
position
- A reference to the top left cell where the pivot table will start
(position - 对数据透视表开始的左上角单元格的引用)
@Beta public XSSFPivotTable createPivotTable(Name source, CellReference position, Sheet sourceSheet)
source
- location of pivot data
(源 - 枢轴数据的位置)
position
- A reference to the top left cell where the pivot table will start
(position - 对数据透视表开始的左上角单元格的引用)
sourceSheet
- The sheet containing the source data, if the source reference doesn't contain a sheet name
(sourceSheet - 如果源引用不包含工作表名称,则包含源数据的工作表)
java.lang.IllegalArgumentException
- if source references a sheet different than sourceSheet
(java.lang.IllegalArgumentException - 如果源引用的工作表不同于 sourceSheet)
@Beta public XSSFPivotTable createPivotTable(Name source, CellReference position)
source
- location of pivot data
(源 - 枢轴数据的位置)
position
- A reference to the top left cell where the pivot table will start
(position - 对数据透视表开始的左上角单元格的引用)
@Beta public XSSFPivotTable createPivotTable(Table source, CellReference position)
source
- location of pivot data
(源 - 枢轴数据的位置)
position
- A reference to the top left cell where the pivot table will start
(position - 对数据透视表开始的左上角单元格的引用)
@Beta public java.util.List<XSSFPivotTable> getPivotTables()
public int getColumnOutlineLevel(int columnIndex)
Sheet
getColumnOutlineLevel
in interface
Sheet
(接口表中的getColumnOutlineLevel)
public void addIgnoredErrors(CellReference cell, IgnoredErrorType... ignoredErrorTypes)
cell
- Cell.
(细胞 - 细胞。)
ignoredErrorTypes
- Types of error to ignore there.
(ignoreErrorTypes - 要在此处忽略的错误类型。)
public void addIgnoredErrors(CellRangeAddress region, IgnoredErrorType... ignoredErrorTypes)
region
- Range of cells.
(region - 单元格范围。)
ignoredErrorTypes
- Types of error to ignore there.
(ignoreErrorTypes - 要在此处忽略的错误类型。)
public java.util.Map<IgnoredErrorType,java.util.Set<CellRangeAddress>> getIgnoredErrors()
protected void onSheetDelete()
protected void onDeleteFormula(XSSFCell cell, BaseXSSFEvaluationWorkbook evalWb)
cell
- The cell that is removed
(cell - 被移除的单元格)
evalWb
- BaseXSSFEvaluationWorkbook in use, if one exists
(evalWb - 正在使用的 BaseXSSFEvaluationWorkbook(如果存在))
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTOleObject readOleObject(long shapeId)
shapeId
- the shape id
(shapeId - 形状 ID)
public XSSFHeaderFooterProperties getHeaderFooterProperties()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.