lakshmanan032 Posted June 30, 2015 Posted June 30, 2015 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 wrongout = 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.jarpoi-3.9-20121203.jarcommons-digester-1.7.jarjfreechart-1.0.14.jarjoda-time-2.4.jar Thanks in advance..
lakshmanan032 Posted June 30, 2015 Author Posted June 30, 2015 Updating to poi-3.10.1.jar solved my issue..
davidmoncayo4 Posted June 25, 2018 Posted June 25, 2018 It also worked for me with poi-3.17 adding it to the maven dependencies.Now, exporterXLS.setParameter(....) is deprecated.Here's the current way to do ithttps://stackoverflow.com/questions/24117878/jasperreports-5-6-jrxlsexporter-setparameter-is-deprecated
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now