Jump to content

Recommended Posts

Posted

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..

 

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...