Hi ,
 
   In my project i have a requiremt in generating report in Excel format.
 
But when i am integrating my .jrxml files with my program, its throwing me out of memory exception. For small data the reports are generating properly.
But for large datas its throwing me exception. If anybody can help me regarding this, then it will be a great help. I am also sending the code.
 
JasperDesign jasperDesign = JasperManager.loadXmlDesign(strPath+"report\\newmember\\newmember_landscape.jrxml");
    JasperReport jasperReport = JasperManager.compileReport(jasperDesign);
    java.io.ByteArrayOutputStream output = new java.io.ByteArrayOutputStream();
    for(int i=0;i<siteName.length;i++)
    {
     java.io.OutputStream outputfile= new java.io.FileOutputStream(new java.io.File(strPath+"report\\newmember\\newMemberList.xls"));
     Map parameters = new HashMap();
     parameters.put("fromDt",printForm.getFromDt());
     parameters.put("toDt",printForm.getToDt());
     parameters.put("siteCode",siteName[i]);     
     JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conClp);
     JRXlsExporter exporterXLS = new JRXlsExporter();
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.JASPER_PRINT, jasperPrint);
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.OUTPUT_STREAM, output);
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE, Boolean.FALSE);
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE);
     exporterXLS.setParameter(net.sf.jasperreports.engine.export.JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
     exporterXLS.exportReport();
     outputfile.write(output.toByteArray());
 
 
Regards
Girija


Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions

Reply via email to