excel-plus icon indicating copy to clipboard operation
excel-plus copied to clipboard

使用模板导出,内容写入有问题,没有填充模板而是新建sheet写入了

Open zmingchun opened this issue 6 years ago • 2 comments

如题。

zmingchun avatar Jan 16 '19 10:01 zmingchun

Writer.create()
                            .headerStyle((wb, style) -> {
                                Font font = wb.createFont();
                                font.setFontHeightInPoints((short) 20);
                                font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
                                style.setFont(font);
                            })
                           .withTemplate(classPath + File.separator + "template" + File.separator + "stat_channel_template_ceping.xlsx")
                            .withRows(pageList.getList().stream().map(v -> {
                                StatChannelExportVo exportVo = new StatChannelExportVo();
                                exportVo.patch(v);
                                return exportVo;
                            }).collect(Collectors.toList()))
                            .to(ResponseWrapper.create(response, fileName+".xlsx"));

zmingchun avatar Jan 16 '19 10:01 zmingchun

模板导入的模板长什么样啊

maodou38 avatar Jul 27 '21 00:07 maodou38