Jump to content
Changes to the Jaspersoft community edition download ×

Image Blank in Excel Report


Recommended Posts

By: louis_gely - louis_gely

Image Blank in Excel Report

2006-05-23 01:32

Hi every one.

 

I want to insert a logo in my Excel report. Jasper find the image, but in the Excel file I've only got a blank...

 

The options for my image :

 

Transparent : true

Print repeated values : true

Image Expression : $P{prmURLImage} (it's a string)

-> "C:\Documents and Settings\gely_l\Desktop\ca.jpg"

Image Expression Class : java.lang.string

Scale Image : RetainShape

Evaluation time : Now

 

That's it!

 

Any body have a suggestion?

 

Thank you in advance!

 

Louis

 

 

 

 

By: louis_gely - louis_gely

RE: Image Blank in Excel Report

2006-05-23 02:17

I saw on the JasperReports WebSite this :

 

"Images are not appearing in XLS format top

 

The Jakarta POI library that we use when exporting the report to XLS format does not currently supports images.

A newer XLS exporter implementation that uses the JExcelApi library is available in the /demo/samples/jexcelapi folder of the project distribution and it supports images."

 

So I tried to use the JExcelApiExporter instead of the JRXlsExporter but nothing work at all...

 

I have these errors :

 

ava.lang.NoClassDefFoundError: com/keypoint/PngEncoderB

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

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

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

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

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportToFile(DefaultJRInstance.java:196)

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportTo(DefaultJRInstance.java:150)

at clam.epe.reportingEnt.reportingAVP.ReportAVPCreator.service(ReportAVPCreator.java:149)

at clam.epe.reportingEnt.reportingAVP.REPORT_AVP.executeReport(REPORT_AVP.java:78)

at clam.epe.reportingEnt.reportingAVP.Report_AVP_Lancement.main(Report_AVP_Lancement.java:45)

- DefaultJRInstance.exportToFile :: Erreur [class net.sf.jasperreports.engine.JRException] - [The cell cannot be added]

java.lang.NoClassDefFoundError: com/keypoint/PngEncoderB

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

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

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

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

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportToFile(DefaultJRInstance.java:196)

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportTo(DefaultJRInstance.java:150)

at clam.epe.reportingEnt.reportingAVP.ReportAVPCreator.service(ReportAVPCreator.java:149)

at clam.epe.reportingEnt.reportingAVP.REPORT_AVP.executeReport(REPORT_AVP.java:78)

at clam.epe.reportingEnt.reportingAVP.Report_AVP_Lancement.main(Report_AVP_Lancement.java:45)

 

NESTED BY :

net.sf.jasperreports.engine.JRException: The cell cannot be added

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

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

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

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

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportToFile(DefaultJRInstance.java:196)

at clam.epe.jasper.reports.jasperReports.DefaultJRInstance.exportTo(DefaultJRInstance.java:150)

at clam.epe.reportingEnt.reportingAVP.ReportAVPCreator.service(ReportAVPCreator.java:149)

at clam.epe.reportingEnt.reportingAVP.REPORT_AVP.executeReport(REPORT_AVP.java:78)

at clam.epe.reportingEnt.reportingAVP.Report_AVP_Lancement.main(Report_AVP_Lancement.java:45)

Caused by: java.lang.NoClassDefFoundError: com/keypoint/PngEncoderB

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

... 8 more

 

Thanks

 

 

 

 

By: louis_gely - louis_gely

RE: Image Blank in Excel Report

2006-05-23 02:31

Problem resolve, I forgot the png-encoder.jar.

 

All works!

 

Thanks again!

 

 

 

 

By: karibouxe - karibouxe

RE: Image Blank in Excel Report

2006-05-23 05:24

I use your solution, but when i generate and save on my hard disk, it work. Whereas it don't display when i decide to display only in my browser.

The logo is blank, i must just touch the image blank and my logo display. you are the same problem or not?

 

 

 

 

By: louis_gely - louis_gely

RE: Image Blank in Excel Report

2006-05-23 05:29

I don't think so, because my problem was specific to Excel Export. I don't know if it is the same problem.

 

Sorry

 

 

 

 

By: karibouxe - karibouxe

RE: Image Blank in Excel Report

2006-05-23 05:40

I've the same problem, i don't display my logo with excel. Now, when i generate with IReport, it work.

But when i generate with my jsp, the logo is "hide", i must modify my "icon blank" to display my logo.

 

 

 

 

 

By: louis_gely - louis_gely

RE: Image Blank in Excel Report

2006-05-23 05:45

Are you using the JExcelApiExporter? Are you working at least with the 1.2.1 version of JasperReports? If not that is why your logo isn't display...

 

 

PS : Sorry for my english I'm French!

 

 

 

 

By: karibouxe - karibouxe

RE: Image Blank in Excel Report

2006-05-23 05:52

Don't worry, I understand ;-)

 

Look my classpath:

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-beanutils-1.5.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-collections-2.1.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-digester-1.7.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-javaflow-20060411.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-logging-1.0.2.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/commons-logging-api-1.0.2.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/itext-1.3.1.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/jcommon-1.0.0.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/jfreechart-1.0.0.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/jxl.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/png-encoder-1.5.jar

#/MIDDLE/sfr/GCRPPadmin.axime.com/lib/jasperreports-1.2.2.jar

 

and my code is:

JExcelApiExporter exporter = new JExcelApiExporter();

exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,outStr);

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

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

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

exporter.exportReport();

 

you're not the same problem when you want display your report in your web browser?

 

 

 

 

By: louis_gely - louis_gely

RE: Image Blank in Excel Report

2006-05-23 07:48

You make the same error as i made :

 

"exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,outStr);

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

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

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

"

 

You put JRXlsExporterParameter instead of JExcelApiExporterParameter.

 

Try this!

 

 

 

 

By: karibouxe - karibouxe

RE: Image Blank in Excel Report

2006-05-23 08:35

it's true, i changed my code. but my logo display only if i hit on it. forget it, it's certainly a bug or a false configuration on my browser :-S

 

Thanks,

Link to comment
Share on other sites

  • 2 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello,

 

I am using netbean and I have a servlet which provides me html/pdf and Excel format.

 

I tried to use JExcelApiExporter class for exporting my reports,which contains Image,in Excel but I got this error:

 

cannot find symbol

symbol : class JExcelApiExporter

JExcelApiExporter exporterXLS = new JExcelApiExporter();

 

I added all the jasperREports 1.2.7 library but still it did not work.

 

Please help me to solve my problem.I am so stucked in

:(

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