类 ExcelUtil
java.lang.Object
org.jeecgframework.poi.util.ExcelUtil
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringgetCellValue(org.apache.poi.ss.usermodel.Cell cell) 获取单元格的值static StringgetMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 获取合并单元格的值static booleanhasMerged(org.apache.poi.ss.usermodel.Sheet sheet) 判断sheet页中是否含有合并单元格static booleanisMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 判断指定的单元格是否是合并单元格static booleanisMergedRow(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 判断合并了行static voidstatic voidmergeRegion(org.apache.poi.ss.usermodel.Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) 合并单元格static voidreadContent(String fileName) 从excel读取内容readExcel(org.apache.poi.ss.usermodel.Workbook wb, int sheetIndex, int startReadLine, int tailLine) 读取excel文件readExcelToObj(String path) 读取excel数据static Stringremove0Suffix(Object value) 数字值,去掉.0后缀
-
构造器详细资料
-
ExcelUtil
public ExcelUtil()
-
-
方法详细资料
-
main
-
readExcelToObj
读取excel数据- 参数:
path-
-
readExcel
public static ArrayList<Map<String,String>> readExcel(org.apache.poi.ss.usermodel.Workbook wb, int sheetIndex, int startReadLine, int tailLine) 读取excel文件- 参数:
wb-sheetIndex- sheet页下标:从0开始startReadLine- 开始读取的行:从0开始tailLine- 去除最后读取的行
-
getMergedRegionValue
public static String getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 获取合并单元格的值- 参数:
sheet-row-column-- 返回:
-
isMergedRow
public static boolean isMergedRow(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 判断合并了行- 参数:
sheet-row-column-- 返回:
-
isMergedRegion
public static boolean isMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet, int row, int column) 判断指定的单元格是否是合并单元格- 参数:
sheet-row- 行下标column- 列下标- 返回:
-
hasMerged
public static boolean hasMerged(org.apache.poi.ss.usermodel.Sheet sheet) 判断sheet页中是否含有合并单元格- 参数:
sheet-- 返回:
-
mergeRegion
public static void mergeRegion(org.apache.poi.ss.usermodel.Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) 合并单元格- 参数:
sheet-firstRow- 开始行lastRow- 结束行firstCol- 开始列lastCol- 结束列
-
getCellValue
获取单元格的值- 参数:
cell-- 返回:
-
remove0Suffix
数字值,去掉.0后缀- 参数:
cell-- 返回:
-
readContent
从excel读取内容
-