类 ExcelUtil

java.lang.Object
com.alibaba.excel.EasyExcelFactory
cn.jrack.excel.core.util.ExcelUtil

public class ExcelUtil extends com.alibaba.excel.EasyExcelFactory
Excel 工具类
  • 构造器详细资料

    • ExcelUtil

      public ExcelUtil()
  • 方法详细资料

    • exportExcel

      public static void exportExcel(Excel excel) throws IOException
      抛出:
      IOException
    • downloadExcel

      public static <T> void downloadExcel(javax.servlet.http.HttpServletResponse response, String filename, String sheetName, Class<T> head, List<T> data) throws IOException
      将列表以 Excel 响应给前端
      类型参数:
      T - 泛型,保证 head 和 data 类型的一致性
      参数:
      response - 响应
      filename - 文件名
      sheetName - Excel sheet 名
      head - Excel head 头
      data - 数据列表哦
      抛出:
      IOException - 写入失败的情况
    • readExcel

      public static <T> List<T> readExcel(org.springframework.web.multipart.MultipartFile file, Class<T> head) throws IOException
      抛出:
      IOException
    • readExcel

      public static <T> List<T> readExcel(File file, Class head)
    • readExcel

      public static <T> List<T> readExcel(File file, Class head, com.alibaba.excel.read.listener.ReadListener readListener)
    • readExcel

      public static List<List<String>> readExcel(String path)