public class ExcelUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_KEY |
static String |
OFFICE_EXCEL_XLS |
static String |
OFFICE_EXCEL_XLSX |
| 构造器和说明 |
|---|
ExcelUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getCellValue(org.apache.poi.ss.usermodel.Cell cell) |
static List<org.apache.poi.ss.util.CellRangeAddress> |
getCombineCell(org.apache.poi.ss.usermodel.Sheet sheet)
合并单元格处理,获取合并行
|
static String |
getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
获取合并单元格的值
|
static String |
isCombineCell(List<org.apache.poi.ss.util.CellRangeAddress> listCombineCell,
org.apache.poi.ss.usermodel.Cell cell,
org.apache.poi.ss.usermodel.Sheet sheet)
判断单元格是否为合并单元格,是的话则将单元格的值返回
|
static boolean |
isMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
判断指定的单元格是否是合并单元格
|
static <T> List<T> |
readExcel(org.springframework.web.multipart.MultipartFile multipartFile,
int sheetIdx,
Class<T> clazz,
int beginRow) |
static <T> void |
readExcel(org.springframework.web.multipart.MultipartFile multipartFile,
int sheetIdx,
Class<T> clazz,
int beginRow,
Page<T> page) |
static <T> List<T> |
readExcel(String excelFile,
int sheetIdx,
Class<T> clazz,
int beginRow) |
static <T> Page<T> |
readExcel(String excelFile,
int sheetIdx,
Class<T> clazz,
int beginRow,
Page<T> page) |
static List<String> |
readRowAsList(org.apache.poi.ss.usermodel.Row row,
int beginIdx) |
static <T> org.apache.poi.ss.usermodel.Workbook |
writeToNew(List<T> dataList) |
static <T> org.apache.poi.ss.usermodel.Workbook |
writeToTemplate(InputStream templateIs,
int sheetIdx,
int beginRow,
List<T> dataList) |
public static <T> org.apache.poi.ss.usermodel.Workbook writeToTemplate(InputStream templateIs, int sheetIdx, int beginRow, List<T> dataList)
public static <T> org.apache.poi.ss.usermodel.Workbook writeToNew(List<T> dataList)
public static <T> void readExcel(org.springframework.web.multipart.MultipartFile multipartFile,
int sheetIdx,
Class<T> clazz,
int beginRow,
Page<T> page)
public static <T> List<T> readExcel(org.springframework.web.multipart.MultipartFile multipartFile, int sheetIdx, Class<T> clazz, int beginRow)
public static <T> List<T> readExcel(String excelFile, int sheetIdx, Class<T> clazz, int beginRow)
public static <T> Page<T> readExcel(String excelFile, int sheetIdx, Class<T> clazz, int beginRow, Page<T> page)
public static List<String> readRowAsList(org.apache.poi.ss.usermodel.Row row, int beginIdx)
public static String getCellValue(org.apache.poi.ss.usermodel.Cell cell)
public static List<org.apache.poi.ss.util.CellRangeAddress> getCombineCell(org.apache.poi.ss.usermodel.Sheet sheet)
sheet - public static String isCombineCell(List<org.apache.poi.ss.util.CellRangeAddress> listCombineCell, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.Sheet sheet)
listCombineCell - 存放合并单元格的listcell - 需要判断的单元格sheet - sheetpublic static String getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column)
sheet - row - column - public static boolean isMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet,
int row,
int column)
sheet - row - 行下标column - 列下标Copyright © 2018. All rights reserved.