100个Java工具类之5多种方式解析和通过List生成Excel
该系列为java工具类系列,主要展示100个常用的java工具类。
此文重点讲述:多种方式解析Excel。
本文目录:通过List生成Excel文件解析Excel文件(入参是MultipartFile)解析Excel文件(入参是Excel本地路径)
一、通过List生成Excel文件import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.usermodel.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.*; /** * @Author 程序幻境 * @Date 2022/11/19 * @Version 1.0 */ class ExcelUtils { private static ExcelUtils instance = new ExcelUtils(); private ExcelUtils(){} public static ExcelUtils getInstance(){ return instance; } /** * 将 List