类 ExcelUtil

java.lang.Object
org.jeecgframework.poi.util.ExcelUtil

public class ExcelUtil extends Object
  • 构造器详细资料

    • ExcelUtil

      public ExcelUtil()
  • 方法详细资料

    • main

      public static void main(String[] args)
    • readExcelToObj

      public static ArrayList<Map<String,String>> readExcelToObj(String path)
      读取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

      public static String getCellValue(org.apache.poi.ss.usermodel.Cell cell)
      获取单元格的值
      参数:
      cell -
      返回:
    • remove0Suffix

      public static String remove0Suffix(Object value)
      数字值,去掉.0后缀
      参数:
      cell -
      返回:
    • readContent

      public static void readContent(String fileName)
      从excel读取内容