Jump to content
We've recently updated our Privacy Statement, available here ×

problem of exporting image to excel


eloh

Recommended Posts

Hi all,

 

I add the following code to see if it works, but I get the exception:

JExcelApiExporter exporter = new JExcelApiExporter();

 

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, file.toString() + ".xls");

exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

 

exporter.exportReport();

 

//I also try to use JExcelApiExporterParameter, but I still get the exception

//exporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jasperPrint);

//exporter.setParameter(JExcelApiExporterParameter.OUTPUT_FILE_NAME,file.toString());

//exporter.exportReport();

 

Here is the exception:

java.lang.NoSuchFieldError: IHDR

at com.keypoint.PngEncoderB.writeHeader(PngEncoderB.java:260)

at com.keypoint.PngEncoderB.pngEncode(PngEncoderB.java:185)

at com.keypoint.PngEncoderB.pngEncode(PngEncoderB.java:208)

at net.sf.jasperreports.engine.export.JExcelApiExporter.loadImageDataFromAWTImage(JExcelApiExporter.java:620)

at net.sf.jasperreports.engine.export.JExcelApiExporter.exportImage(JExcelApiExporter.java:595)

at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:356)

at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:246)

at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:154)

Would you mind to help me out.

 

Thanks in advance.

Eva

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You seem to have conflicting versions of com.keypoint.PngEncoderA and com.keypoint.PngEncoderB on your classpath. If you have a jar named png-encoder-* on your classpath, move it at the beginning of the classpath. Otherwise, inspect all the jars on the classpath and see which contains these classes.

 

HTH,

Lucian

Link to comment
Share on other sites

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...