use of com.hummer.nacos.model.HeaderDemo2 in project hummer-framework by hummer-team.
the class ExcelController method queryUserContext.
@ApiOperation("多标题栏导出")
@GetMapping("/export/table")
public void queryUserContext(HttpServletRequest request, HttpServletResponse response) throws IOException {
List<TableWriteDataBo> list = new ArrayList<>(2);
TableWriteDataBo bo = new TableWriteDataBo();
bo.setHeadClass(HeaderDemo.class);
bo.setDataInfos(data(1, HeaderDemo.class));
TableWriteDataBo bo2 = new TableWriteDataBo();
bo2.setHeadClass(HeaderDemo2.class);
bo2.setDataInfos(data(5, HeaderDemo2.class));
bo2.setWithHead(true);
list.add(bo);
list.add(bo2);
String sheet = "table";
String fileName = "tableWrite_" + System.currentTimeMillis() + ExcelTypeEnum.XLSX.getValue();
ServletOutputStream os = response.getOutputStream();
HttpServletResponseUtil.composeExcelResponseHeaders(response, fileName);
TableWriteTemplate.getInstance().tableWrite(list, sheet, os);
}
Aggregations