PDA

View Full Version : problem with servlet upgrading from JFreeReport



pepinfor
12-14-2007, 08:13 AM
Hi,
untill now, I was using JFreeReport 0.7.x.
Now I upgraded to pentaho-reporting-engine-classic-0.8.9.2. For desktop application i was able to modify my sources in the right way but for a J2EE application I have some trouble. I use an XML file with report definition.
My old code was:
res.setContentType("application/pdf");
final URL in =
ObjectUtilities.getResource(
DemoConstants.REPORT_DEFINITION,
StampaRivalutazioni.class);
final ReportGenerator generator = ReportGenerator.getInstance();

// display the content in the browser window (see RFC2183)
res.setHeader(
"Content-Disposition",
"inline; filename=\"" + toPrint + ".pdf\"");
final JFreeReport report =
generator.parseReport(new java.io.File("myfile.xml"));

ServletOutputStream outputStream = res.getOutputStream();

report.setData(filtraModTab(tabCalc, ses));

final PDFOutputTarget target =
new PDFOutputTarget(outputStream);
target.configure(report.getReportConfiguration());
target.open();
final PageableReportProcessor proc =
new PageableReportProcessor(report);
proc.setOutputTarget(target);
proc.processReport();
target.close();
outputStream.close();
The red methods are incorrect with this new version.
It seems that the constructor PageableReportProcessor now wants 2 parameters and that the setOutputTarget method doesn't exist yet.
What I have to do?
Thanks in advance.

marie.patterson
12-19-2007, 11:24 AM
Do you know what jar file has the classes for PDFOutputTarget.java and ReportGenerator.java


Thank you.

pepinfor
12-21-2007, 06:00 AM
But now there is only one jar: pentaho-reporting-engine-classic-0.8.9.2.jar
I don't find any other jar!