use of com.alibaba.excel.write.executor.ExcelWriteFillExecutor in project easyexcel by alibaba.
the class ExcelBuilderImpl method fill.
@Override
public void fill(Object data, FillConfig fillConfig, WriteSheet writeSheet) {
try {
if (context.writeWorkbookHolder().getTempTemplateInputStream() == null) {
throw new ExcelGenerateException("Calling the 'fill' method must use a template.");
}
if (context.writeWorkbookHolder().getExcelType() == ExcelTypeEnum.CSV) {
throw new ExcelGenerateException("csv does not support filling data.");
}
context.currentSheet(writeSheet, WriteTypeEnum.FILL);
if (excelWriteFillExecutor == null) {
excelWriteFillExecutor = new ExcelWriteFillExecutor(context);
}
excelWriteFillExecutor.fill(data, fillConfig);
} catch (RuntimeException e) {
finishOnException();
throw e;
} catch (Throwable e) {
finishOnException();
throw new ExcelGenerateException(e);
}
}
Aggregations