James Jenkins
James Jenkins

Reputation: 1954

How can I get images into my Excel reports with BIRT?

I have some reports that have images that look great as web pages, or PDF, but the images are not coming over when the report is opened in Excel.

Upvotes: 0

Views: 2415

Answers (2)

Praveena Thangavel
Praveena Thangavel

Reputation: 11

Use the Native Excel Emitter for Excel format, instead of default excel emitter.

You can download plugin from here:

  1. Extract the jar using any of any of the archive software(eg. winzip, 7-zip,etc) and keep it separately.

  2. After extracting the jar file, copy the 'jar' files in your own project's folder (webapp/web-inf/lib).

  3. And also add the original downloaded jar (org.eclipse.birt.report.engine.emitter.nativexls.jar) into your project's folder (webapp/web-inf/lib).

  4. And add the class path (Right click Project → Configure Build Path → Add Jar → Select the jar files you have added from the lib folder).

Note: For Maven Projects only

If you are using Maven Projects, then you should add the jar files in your maven repository.

In command prompt, type the following commands:

mvn install:install-file -Dfile=c:\kaptcha.jar -DgroupId=com.google.code 
-DartifactId=kaptcha -Dversion={version} -Dpackaging=jar

Instead of follow the step 4, follow the below steps:

  1. Right click Project → Config Build Path → Add Variable.
  2. Select your maven repository variable.
  3. Click 'Extend' button.
  4. Under select your jar and click 'ok' button.

You should also add the jar files which is extracted from the org.eclipse.birt.report.engine.emitter.nativexls.jar (in lib folder)

In java, under the Excel Format option, add the following line also:

ExcelRenderOption option=new ExcelRenderOption();
option.setOption(IRenderOption.EMITTER_ID,"org.eclipse.birt.report.engine.emitter.nativexls");

Upvotes: 1

Dominique
Dominique

Reputation: 4332

What is your birt version? Images are supported in Excel only from birt 4.3, with spudsoft xls & xlsx emitters. For older versions that's quite more tricky but we can still inlcude these emitters, or the native excel emitter.

Upvotes: 2

Related Questions