Jump to content

BIRT Developer Center Download


File Information

  • Submitted: Aug 07 2013 11:22 AM
  • Last Updated: Apr 28 2014 07:55 AM
  • File Size: 21.44KB
  • Views: 30723
  • Downloads: 82
  • Approved by: mwilliams
  • Approved on: 28 April 2014 - 07:55 AM
  • Summary: BIRT 4.3.0 has a lot of improvements over BIRT 4.2.2, and makes steps towards working better with Apache Maven than ever before. This article explains some gotchas and provides some code to avoid them.
  • Content Type: Designs & Code
  • BIRT Version: 4.3

Download Using BIRT 4.3.0 with Maven

- - - - -
4.3.0 maven Maven

Integrating BIRT (POJO engine) with maven ought to be as simple as placing the following dependency into your pom.xml:
Unfortunately as soon as you do that you run into the first problem: there is a dependency on a private build of Apache POI that is not in maven. To work around this you can exclude that build of POI and bring in the full version:
That will work, but it still has a few problems:
  • Although the main Apache POI classes have been excluded from the mavenised BIRT, they have failed to remove a lot of other classes (e.g. the XML beans schema classes for the MS Office file formats).

    The inclusion of these files doesn't stop BIRT from working as long as you are using POI 3.9, though they do bloat the resulting jar.

    If you want to use POI 3.10 the inclusion of these files could present real problems as that will come with (probably different) versions.
  • BIRT comes with the SpudSoft BIRT Excel Emitters, which makes it difficult to replace them with newer versions from BitBucket.
So, if you want to use a new version of either POI or the SpudSoft Excel Emitters (which I recommend) you have to take more steps.

The approach to take is to use the maven shade plugin to modify the BIRT jar file, stripping out the unwanted files and, as a bonus, replacing any files within the jar that are found to contain bugs.

The attached zip file contains a complete maven project that results in a new BIRT jar file that you can deploy to your local maven repository.

At a minimum the maven shade project needs to contain the following files:
  • /pom.xml
  • /src/main/resources/plugin.xml
    \nModified to remove the built-in version of the SpudSoft Excel Emitters.
  • /src/main/resources/META-INF/MANIFEST.MF
    \nModified to remove all the hashes for the compiled jars.
The key parts of the pom.xml are the base dependency:
and the maven shade configuration:
					<exclude>schemasMicrosoftCom*/**</exclude>\n					<exclude>uk/co/spudsoft/**</exclude>
As a bonus the zip also contains a replacement for the file /src/main/java/org/eclipse/birt/report/engine/executor/ListingElementExecutor.java which fixes BIRT bug 413607.

When you use the jar file that this produces you must ensure that you add in a dependency for the correct version of POI and the SpudSoft Excel Emitters (which I'm afraid are not in maven yet, you should add them to your local maven repository manually).

I hope this is helpful to someone.

Your are a real Hero! I did add this Lib to my maven-repo and add it as an dependency to my TestApplication.


It works fine!


my Main-Class Code:


package de.bla;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.*;
import org.eclipse.core.internal.registry.RegistryProviderFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class FunGenerator {
     * Current Logger.
    //private static org.apache.log4j.Logger LOG = Logger.getLogger(FunGenerator.class);
    public static void main (String[] args) {
        String reportDesignFilePath = "C:\\AngryBIRT\\reports\\empty_report.rptdesign";
        //String birtHomeDir = "C:\\AngryBIRT\\birt-engine\\ReportEngine";
        String logDir = "C:\\log";
        //String configDir = "";
        String resourcesDir = "C:\\AngryBIRT\\resources\\";
        String outputDir = "C:\\AngryBIRT\\output";
        IReportEngine engine = null;
        EngineConfig config = null;
        FileInputStream fileInputStream = null;
        try {
//read this in www
            System.setProperty("RUN_UNDER_ECLIPSE", "false");
            config = new EngineConfig();
            config.setLogConfig(logDir, Level.ALL);
            // important for BIRT to know resources
            // Render Option
            PDFRenderOption PDF_OPTIONS = new PDFRenderOption();
            // Default Render Option
            config.setDefaultEmitter("pdf", PDF_OPTIONS.getEmitterID());
            // startup this config
            // create Report Engine
            final IReportEngineFactory FACTORY = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
            engine = FACTORY.createReportEngine(config);
            fileInputStream = new FileInputStream(reportDesignFilePath);
            IReportRunnable design = engine.openReportDesign(fileInputStream); // engine.openReportDesign("");
            IRunAndRenderTask task = engine.createRunAndRenderTask(design);
            task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, FunGenerator.class.getClassLoader());
            File reportDesignFile = new File(reportDesignFilePath);
            String outputFilePath = outputDir + "\\" + reportDesignFile.getName().replace(".rptdesign", ".pdf");
            File pdfFile = new File(outputFilePath);
            if (!pdfFile.exists()) {
            // set the render option
            // runs the report and generate output.
            // close the report.
            // free engine
        } catch (BirtException e) {
        } catch (FileNotFoundException e) {
        } finally {
            // shutdown Platform
            // release registries
            try {
                if (fileInputStream != null) {
            } catch (IOException e) {
i dont need set BIRTHome
i used jdk 1.6_45
the Report has a text nothing else.
I working on the integrate of the excel emitter and poi and I will post it here (soon/later).
GREAT WORK YayTay, I dont know why BIRT is "USER-UNFRIENDLY" or it is a Layer-8 Problem!
(BIRT is great, too. Since Dec 2015 i was frustrated, cause of didn't work out of eclipse)

  • 997 Total Files
  • 8 Total Categories
  • 153 Total Authors
  • 31732 Total Downloads
  • Joyplot in iHub Latest File
  • Clement Wong Latest Submitter

1 user(s) are online (in the past 1 minutes)

0 members, 1 guests, 0 anonymous users