FillData f1 = new FillData(); f1.setDaKuohao(""); f1.setFirstLayer("{.sa}"); f1.setSecondLayer("s1"); f1.setThirdLayer("t1"); f1.setCloumnPorperty("{.sa}");
FillData f2 = new FillData(); f1.setDaKuohao("{"); f2.setFirstLayer("clou1"); f2.setSecondLayer("s2"); f2.setThirdLayer("t12"); f2.setCloumnPorperty("{.sa}");
List
String fileName = TestFileUtil.getPath() + "horizontalFill" + System.currentTimeMillis() + ".xlsx"; // 方案1 try (ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build()) { WriteSheet writeSheet = EasyExcel.writerSheet().registerWriteHandler(new FillBgColorStyleCellWriteHandler()).build(); FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.HORIZONTAL).build(); excelWriter.fill(data, fillConfig, writeSheet); excelWriter.fill(data, fillConfig, writeSheet); excelWriter.fill(data, fillConfig, writeSheet); Map<String, Object> map = new HashMap<>(); map.put("date", "2019年10月9日13:28:28"); excelWriter.fill(map, writeSheet); }