diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java index 84cc9ef4c9..bf2ab8908b 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java @@ -23,6 +23,7 @@ import java.net.URL; import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.eclipse.birt.core.exception.BirtException; import org.eclipse.birt.report.engine.api.IRenderOption; import org.eclipse.birt.report.engine.content.IAutoTextContent; @@ -342,6 +343,9 @@ public void end(IReportContent report) throws BirtException { log.debug("ex:", ex.toString()); } } + if (handlerState.getWb() instanceof SXSSFWorkbook) { + ((SXSSFWorkbook) handlerState.getWb()).dispose(); + } handlerState = null; reportOutputFilename = null; reportOutputStream = null;