Jasper report exports empty data in PDF format when there is more data
Posted
by stanley
on Stack Overflow
See other posts from Stack Overflow
or by stanley
Published on 2009-10-29T06:13:53Z
Indexed on
2010/06/15
10:42 UTC
Read the original article
Hit count: 487
java
|jasper-reports
I have a report to be exported in excel, pdf and word using jasper reports. I use xml file as the DataSource for the report, but when the data increases jasper report exports empty file in only for PDF format, when i reduce the data content it export the data available correctly. is there any limitation to pdf size? , how can we manage the size in jasper reports from java?
My jrxml is really big, so i cannot add it here, i have added my java code which i use to export the content:-
JRAbstractExporter exporter = null; if (format.equals("pdf")) { exporter = new JRPdfExporter(); jasperPrint.setPageWidth(Integer.parseInt( pWidth )); } else if (format.equals("xls")) { exporter = new JRXlsExporter();
} else if (format.equals("doc")) { jasperPrint.setPageWidth(Integer.parseInt( pWidth ));
}
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream_); exporter.exportReport(); contents = outputStream_.toByteArray(); response.setContentType("application/"+format); response.addHeader("Content-disposition", "attachment;filename=" + name.toString() + "."+format);
© Stack Overflow or respective owner