i tryed this too but i wrong something "impossible to open the file" Post Edited by allart at 07/07/2010 09:40 Code:ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();//ServletOutputStream servletOutputStream = resp.getOutputStream();JRXlsExporter exporterXLS = new JRXlsExporter();exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT,print);exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, xlsReport);//exporterXLS.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, request.getRealPath("/reports") + "/" +title+".xls");exporterXLS.exportReport();System.out.println("Sixe of byte array:"+xlsReport.size()); bytes = xlsReport.toByteArray(); System.err.println("size: "+bytes.length); resp.setContentType("application/vnd.ms-excel"); resp.setContentLength(bytes.length); resp.getOutputStream().write(bytes); resp.getOutputStream().flush(); Post Edited by allart at 07/07/2010 09:43