Hello Girija,
What is conClp in your
code?
1)
You can implement the JRDataSource interface and retrieve the the data in chunks
in next() method,
whenever the data is over in the
current chunk, retrieve the next chunk. If the next chunk is empty, the is
over,
so return false.
In the getFieldValue(), return the
value from teh current record in the chunk. Keep an index variable and
manipulate that
in next() method, so that it points
to the current record in the chunk.
2) Check out the Virtualizer concept in the
JasperReports.
Regards,
Raffi
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of girija subudhi
Sent: Tuesday, September 12, 2006 10:25 AM
To: jasperreports-questions@lists.sourceforge.net
Subject: [jasperreports-questions] problem with out of memory exceptionHi ,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());RegardsGirija
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