赞
踩
public static <T> void exportExcelExclude(
HttpServletResponse response, //客户端响应
String sheetName, //表单名
Class clazz, //EO类
List<T> data) {//数据
}
无需配置,按照EO
默认横向书写List中的某个数据,纵向书写整个List
ExcelExclude
是否存在来过滤,得到导出字段excludeListEasyExcel.write(response.getOutputStream(), clazz).excludeColumnFiledNames(excludeList)).sheet(sheetName).doWrite(data);
public static <T> void exportFillExcel(
HttpServletResponse response, //客户端响应对象
String sheetName,//表单名
InputStream templateFileStream,//模板文件流
List<T> list,//数据A
Map<String, Object> map) {//数据B
}
构造器
(创建型模式)基于模板文件构建输出流EXCEL写
对象横纵方向
写
对象基于传入的两种数据使用Sheet 写对象写到客户端InputStream template = this.getClass().getClassLoader().getResourceAsStream(XXX.XLS);
excelWriter.fill(list, fillConfig, writeSheet);
excelWriter.fill(map, writeSheet);
忽略EO,仅读入数据、数据不同 模板文件配置书写有区别
{.propertyName}
{keyName}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。