Jump to content

Recommended Posts

Hello everyone,

I've a problem with jasper to export my report in xls file. (JAVA SE, Eclipse, Windows 8).
I've got an image in my report with an absolute path, when I export into PDF file like that (code bellow) there is no problem 

JasperExportManager.exportReportToPdfFile(jasperPrint, outputFile.getPath());[/code]

but when I try to export into xls file with this code :

JRXlsExporter exporterXLS = new JRXlsExporter(); [/code]
exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);    [/code]
exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_FILE, outputFile);    [/code]
exporterXLS.exportReport();[/code]

 

I've got this error message "The cell cannot be added" (full source bellow) and my xls file is empty.

GRAVE: JRException
net.sf.jasperreports.engine.JRException: The cell cannot be added
at net.sf.jasperreports.engine.export.JRXlsExporter.exportImage(JRXlsExporter.java:1628)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:1000)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:795)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:662)
at com.logetel.atlant.modules.editJasper.RootJasperController.generateTempFile(RootJasperController.java:164)
at com.logetel.atlant.modules.editJasper.RootJasperController.actionPerformed(RootJasperController.java:83)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at org.pushingpixels.substance.internal.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:124)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/codec/digest/DigestUtils
at org.apache.poi.hssf.usermodel.HSSFWorkbook.addPicture(HSSFWorkbook.java:1575)
at net.sf.jasperreports.engine.export.JRXlsExporter.exportImage(JRXlsExporter.java:1616)
... 43 more
 
When I delete this image my xls file is well generated..
 
I precise that my JasperPrint object is not null and all the parameters are well passed (I can generate the PDF, it means everything is OK (query,data,parameters,etc..) )
 
I'm using Substance Look And Feel, could this be because of that ?
 
How can I do to generate the xls file with the image, or at least be able to display my xls without the image file and make it visible only in the pdf file ?
 
thanks all !
 
PS : Sorry for my english, i'm french http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/regular_smile.gif
Link to comment
Share on other sites

well, I've succeeded to remove the image when I want to generate the report in xls file with this command :

jasperPrint.setProperty("net.sf.jasperreports.export.xls.ignore.graphics", "true");[/code]

If someone know anyway how to display the image in both jasper reports (pdf, xls) I'm still interested.

Link to comment
Share on other sites

  • 8 months later...
  • 2 months later...
  • 7 years later...

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