public final class ExcelUtils extends Object
| 构造器和说明 |
|---|
ExcelUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.apache.poi.ss.usermodel.Font |
createFont(org.apache.poi.ss.usermodel.Workbook workbook)
Create a font
|
static String |
createFormula(String suffix,
int firstColIndex,
int firstRowIndex,
int lastColIndex,
int lastRowIndex)
Create a formula
|
static String |
createFormulaX(int startColIndex,
int rowIndex,
int endColIndex)
Horizontal creation formula
|
static String |
createFormulaY(int colIndex,
int startRow,
int endRow)
Vertical creation formula
|
static org.apache.poi.ss.usermodel.Hyperlink |
createLink(org.apache.poi.ss.usermodel.Workbook workbook,
org.apache.poi.common.usermodel.HyperlinkType type)
Create hyperlink
|
static String |
createSumFormula(int firstColIndex,
int firstRowIndex,
int lastColIndex,
int lastRowIndex)
Create a sum formula
|
static org.apache.poi.ss.util.CellRangeAddress |
getCellRangeAddress(org.apache.poi.ss.usermodel.Sheet sheet,
int index)
Get cell range address object
|
static ExcelType |
getExcelType(String fileName)
Check the file type is excel
|
static void |
merge(org.apache.poi.ss.usermodel.Sheet sheet,
int firstCol,
int lastCol,
int firstRow,
int LastRow)
Merge cells
|
static void |
setCellValue(org.apache.poi.ss.usermodel.Cell cell,
Object value)
Set cell value
|
public static void setCellValue(org.apache.poi.ss.usermodel.Cell cell,
Object value)
cell - Current cellvalue - Attribute valuespublic static ExcelType getExcelType(String fileName)
fileName - Excel file namepublic static void merge(org.apache.poi.ss.usermodel.Sheet sheet,
int firstCol,
int lastCol,
int firstRow,
int LastRow)
sheet - Current sheetfirstCol - First column indexlastCol - last column indexfirstRow - First row indexLastRow - Last row indexpublic static org.apache.poi.ss.util.CellRangeAddress getCellRangeAddress(org.apache.poi.ss.usermodel.Sheet sheet,
int index)
sheet - Current sheetindex - address index, start of 0public static String createSumFormula(int firstColIndex, int firstRowIndex, int lastColIndex, int lastRowIndex)
firstColIndex - Which column startfirstRowIndex - Which row startlastColIndex - Which column endlastRowIndex - Which row endpublic static String createFormula(String suffix, int firstColIndex, int firstRowIndex, int lastColIndex, int lastRowIndex)
suffix - Formula suffixfirstColIndex - Which column startfirstRowIndex - Which row startlastColIndex - Which column endlastRowIndex - Which row endpublic static org.apache.poi.ss.usermodel.Font createFont(org.apache.poi.ss.usermodel.Workbook workbook)
workbook - workbookpublic static org.apache.poi.ss.usermodel.Hyperlink createLink(org.apache.poi.ss.usermodel.Workbook workbook,
org.apache.poi.common.usermodel.HyperlinkType type)
workbook - workbooktype - link typepublic static String createFormulaX(int startColIndex, int rowIndex, int endColIndex)
startColIndex - Start column indexrowIndex - Row indexendColIndex - End column indexpublic static String createFormulaY(int colIndex, int startRow, int endRow)
colIndex - colIndexstartRow - start row indexendRow - end row indexCopyright © 2022. All rights reserved.