Search in sources :

Example 1 with ExcelWriteAddExecutor

use of com.alibaba.excel.write.executor.ExcelWriteAddExecutor in project easyexcel by alibaba.

the class ExcelBuilderImpl method addContent.

@Override
public void addContent(Collection<?> data, WriteSheet writeSheet, WriteTable writeTable) {
    try {
        context.currentSheet(writeSheet, WriteTypeEnum.ADD);
        context.currentTable(writeTable);
        if (excelWriteAddExecutor == null) {
            excelWriteAddExecutor = new ExcelWriteAddExecutor(context);
        }
        excelWriteAddExecutor.add(data);
    } catch (RuntimeException e) {
        finishOnException();
        throw e;
    } catch (Throwable e) {
        finishOnException();
        throw new ExcelGenerateException(e);
    }
}
Also used : ExcelWriteAddExecutor(com.alibaba.excel.write.executor.ExcelWriteAddExecutor) ExcelGenerateException(com.alibaba.excel.exception.ExcelGenerateException)

Aggregations

ExcelGenerateException (com.alibaba.excel.exception.ExcelGenerateException)1 ExcelWriteAddExecutor (com.alibaba.excel.write.executor.ExcelWriteAddExecutor)1