public abstract class ExcelExportUtils extends Object
| 构造器和说明 |
|---|
ExcelExportUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
exportExcel(javax.servlet.http.HttpServletResponse response,
org.apache.poi.ss.usermodel.Workbook book,
String fileName)
下载Excel文件
|
static void |
saveToFile(org.apache.poi.ss.usermodel.Workbook book,
String targetFilePath)
将excel保存到文件中
|
static void |
setExcelExportResponse(javax.servlet.http.HttpServletResponse response,
String fileName)
设置导出Excel文件所需的响应信息
|
static <T> void |
toExcelAndExport(javax.servlet.http.HttpServletResponse response,
List<T> dataList,
Class<T> clazz,
String fileName)
数据转换为excel文件并下载
|
public static <T> void toExcelAndExport(javax.servlet.http.HttpServletResponse response,
List<T> dataList,
Class<T> clazz,
String fileName)
throws IOException
T - 数据类型'response - 响应对象dataList - 数据列表clazz - 数据类fileName - 导出文件名IOException - IO异常public static void exportExcel(javax.servlet.http.HttpServletResponse response,
org.apache.poi.ss.usermodel.Workbook book,
String fileName)
throws IOException
response - 响应对象book - the workbookfileName - the file nameIOException - the IO exceptionpublic static void setExcelExportResponse(javax.servlet.http.HttpServletResponse response,
String fileName)
throws IOException
fileName - 文件名response - 响应对象IOException - IO异常public static void saveToFile(org.apache.poi.ss.usermodel.Workbook book,
String targetFilePath)
throws IOException
book - excel对象targetFilePath - 目标文件路径IOException - IO异常Copyright © 2021 EasyJ寮�婧愮ぞ鍖�. All rights reserved.