Jump to content

Trying to migrate Jasperreport 6.xx to 7.0.1. Got some errors and cannot import.


Go to solution Solved by ratipornl321,

Recommended Posts

Posted

Hi guys!

Currently i'm using Jasperreport Ver. 6.21.3 and wanna upgrade to 7.0.1. But i got this error which is cannot import JRPdfExporter and SimplePdfExporterConfiguration for exporting PDF files.

Did Jasper changed package name or be replaced with new class?

I've tried to find out the release note but they tell no about them.

 

Please give me some advices. Thanks in advance!

Cheers!

Rati

---------

My current dependency:

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.21.3</version>
</dependency>


New dependency:

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>7.0.1</version>
</dependency>


Code:

JRPdfExporter pdfExporter = new JRPdfExporter();
pdfExporter.setExporterInput(new SimpleExporterInput(jasperPrint));
pdfExporter.setExporterOutput(new SimpleOutputStreamExporterOutput(bos));

SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
pdfExporter.setConfiguration(configuration);
pdfExporter.exportReport();
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution
Posted

I found the solution already! According to this that 

Quote

In version 7, the functionality has been split into multiple optional JARs. 

 

So I imported this into POM and it works!

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports-pdf</artifactId>
    <version>7.0.1</version>
</dependency>
  • 1 month later...
Posted

You need the PDF dependency:

 

<dependency>
  <groupId>net.sf.jasperreports</groupId>
  <artifactId>jasperreports-pdf</artifactId>
  <version>7.0.1</version>
</dependency>

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...