简体   繁体   中英

Jasper report export to xls is blank always even for simple report

I'm unable to export my jasper report in Excel format but the same works fine for pdf. Below is my code snippet.. Kindly let me know where I'm going wrong

out = response.getOutputStream();

jasperReport = JasperCompileManager.compileReport(filePath + fileName);

jasperPrint = JasperFillManager.fillReport(jasperReport, jasperParam, connection);

JRXlsExporter exporterXLS = new JRXlsExporter();

exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);

exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, out);

exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);

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.exportReport();

I'm using the below jars,

jasperreports-6.1.0.jar poi-3.9-20121203.jar

commons-digester-1.7.jar jfreechart-1.0.14.jar joda-time-2.4.jar

Thanks in advance..

更新到 poi-3.10.1.jar 解决了我的问题..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM