I'm using jasper reports to create a PDF document dynamically from a
java application. However the PDF document I want to create is quite
long - 10 pages and contains lots of static text.
I've hit a problem when it comes to managing to design the PDF
documents to be over one page in length ... is there a way to insert
page breaks or format the document over several pages. Are there xml
tags that can be used ? Could subreports or some other method be used
?
I'm also using iReport designer alongside Jasper Reports but haven't
seen how to manage multiple page documents in that tool either.
If anyone can help with this query I'd really appreciate it.
Thanks,
Niall.
for filling report with data
String sourceFileName = "file.jasper";
String printFile="file.jrprint";
JasperFillManager.fillReportToFile(sourceFileName,printFile,params,
dataSources);
for gathering files in one report
for (Iterator iter = reportFiles.iterator(); iter.hasNext();) {
String fileName = (String) iter.next();
try {
printList.add(JRLoader.loadObject("file.jrprint"));
} catch (JRException e1) {
e1.printStackTrace();
}
}
JRPdfExporter exporter=new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST,
printList);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,
destFileName);
try {
exporter.exportReport();
} catch (JRException e) {
e.printStackTrace();