which library do you use to generate the export ? is is jasper or poi ?
in POI, the workbook itself is autoclosable, so the code would look like the following and you would not have to worry about the response.outputstream
try (WritableWorkbook workbook = Workbook.createWorkbook(response.outputstream ) ) {
}