We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Export Jasper to PDF using Aspose.PDF for JasperReports

Hello,


I am using the evaluation version of the JasperReport PDF Exporter to export from jasper 5.6.0 to PDF. My code below, which is modeled after the example code, but uses the jr5_5_0 package, produces a NoSuchMethodError.

My Code:
com.aspose.pdf.jr5_5_0.jasperreports.JrPdfExporter exporter = new com.aspose.pdf.jr5_5_0.jasperreports.JrPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, file.toString());
exporter.exportReport();

Error:
java.lang.NoSuchMethodError: com.aspose.pdf.jr5_5_0.jasperreports.JrPdfExporter.setInput()V
at com.aspose.pdf.jr5_5_0.jasperreports.JrPdfExporter.B(Unknown Source)
at com.aspose.pdf.jr5_5_0.jasperreports.JrPdfExporter.exportReport(Unknown Source)

I wonder if I should be using a different calling method as the setParameter is marked as deprecated, but I don’t have any API or user documentation that provides a better/different approach.

Please advise.

Hi Gary,


Thanks for your inquiry. I have tested the scenario with jasperreports5.6.0 and noticed following exception instead NoSuchMethod erro. So logged issue as PDFJASPER-33148 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress via this forum thread.

"Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap"

We are sorry for the inconvenience caused.

Best Regards,
After seeing your explanation, I confirmed that org.apache.commons.collections.map.ReferenceMap is available on the classpath and usable by my application by adding the following line prior to calling the aspose library.

org.apache.commons.collections.map.ReferenceMap rm = new org.apache.commons.collections.map.ReferenceMap();

Creating a ReferenceMap from my code worked with issue. So I'm not sure why your code would throw a ClassNotFoundException.

You may need to make sure you have apache commons collections on your classpath for your test. If you do that, I suspect you may find a different error message.

I look forward to hearing more. Without a correction, I cannot complete my evaluation prior to purchase.

Thank You.


After looking into this further today, I can see that JasperReports version 5.6 has changed the API for parameters. I will attempt to backport my code to 5.5 and make it work until you are able to produce a 5.6 compatible release.


Thank you.
Hi Gary,


garyn:
After seeing your explanation, I confirmed that org.apache.commons.collections.map.ReferenceMap is available on the classpath and usable by my application by adding the following line prior to calling the aspose library.

org.apache.commons.collections.map.ReferenceMap rm = new org.apache.commons.collections.map.ReferenceMap();

Creating a ReferenceMap from my code worked with issue. So I'm not sure why your code would throw a ClassNotFoundException.

You may need to make sure you have apache commons collections on your classpath for your test. If you do that, I suspect you may find a different error message.

I look forward to hearing more. Without a correction, I cannot complete my evaluation prior to purchase.

Thank You.



Thanks for your feedback. apache commons collections are already on the classpath. We are looking into the issue and will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi,

so do you have some news regarding this issue?

Hi Gary,


Thanks for your inquiry. I am afraid your reported issue is pending for investigation in queue with other priority issues. We will notify you as soon as we made a significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFJASPER-33148) have been fixed in Aspose.Pdf for JasperReports 1.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.