easyexcel 3.2.1版本,填充excel模板数据当行扩展时后面的图片没有自动往下平移位置

0aydgbwb  于 5个月前  发布在  其他
关注(0)|答案(3)|浏览(49)

建议先去看文档

快速开始常见问题

触发场景描述

excel模板如下图:

填充后的结果如下图:图片没有自动往下平移

excel图片设置如下:

触发Bug的代码

try (ExcelWriter excelWriter = EasyExcel.write(outExcelFile)
              .withTemplate(templateFile)

              .registerConverter(new TimestampStringConverter())
              .registerWriteHandler(new ExcelColumnMergeStrategy())
              .registerWriteHandler(new ExcelRow2MergeStrategy(datamap))
              .build()) {
        WriteSheet writeSheet = EasyExcel.writerSheet().build();

        for (RXPrintDataSet dataSet : dataSets) {

          List<Map<String, Object>> result = datamap.get(dataSet.getName()); //convertData(list, dataSet);

          if (dataSet.getObjectType().equals(FRConstants.PRINT_DATASET_ROW)) {
            FillConfig rowConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).forceNewRow(Boolean.TRUE).build();
            excelWriter.fill(new FillWrapper(dataSet.getName(), result), rowConfig, writeSheet);
          } else if (dataSet.getObjectType().equals(FRConstants.PRINT_DATASET_COLUMN)) {
            FillConfig columnConfig = FillConfig.builder().direction(WriteDirectionEnum.HORIZONTAL).forceNewRow(Boolean.TRUE).build();
            excelWriter.fill(new FillWrapper(dataSet.getName(), result), columnConfig, writeSheet);
          } else if (dataSet.getObjectType().equals(FRConstants.PRINT_DATASET_OBJECT)) {
            if (!CollectionUtils.isEmpty(result)) {
              Map<String, Object> objectMap = result.get(0);
              Map<String, Object> data = new HashMap<>();
              for (Map.Entry<String, Object> entry : objectMap.entrySet()) {
                data.put(dataSet.getName() + "_" + entry.getKey(), entry.getValue());
              }
              excelWriter.fill(data, writeSheet);
            }
          } else {
            throw new RuntimeException("数据集对象类型定义错误");
          }
        }

提示的异常或者没有达到的效果

rqqzpn5f

rqqzpn5f1#

有没有人指导下怎么处理

flmtquvp

flmtquvp2#

@zhuangjiaju@youlingdada

xxe27gdn

xxe27gdn3#

请问下该问题解决了吗?有什么处理方式没有

相关问题