BIRT without OSGi framework

给你一囗甜甜゛ 提交于 2019-12-22 18:40:19

问题


Greetings, we are currently trying to integrate BIRT in our desktop standalone application, using samples from here.

The question is - how to avoid using the OSGi framework. Can we put all the required libraries and plugins in the resulting EAR without having to set the report engine home? Because our clients will not be happy about having to download additional runtime. And is there really a need for such a huge runtime (about 100 megabytes, I guess).


回答1:


Sorry, but there is really no way to run BIRT reports without running OSGi. It is possible to trim some of the modules if you are not using them. Charting for instance could be removed, but Charts won't work. Obviously you can remove the sample database, and the derby plugins that support it.

After those obvious items, it gets a lot more difficult to remove plugins.




回答2:


Since Birt 3.7, you can use the Birt POJO Runtime (you can check the Birt website for it).

The only thing you have to do is to not call EngineConfig.setEngineHome(engineHome)

If you follow the Birt website, your code will look like this:

try{
    final EngineConfig config = new EngineConfig( );
    //As of 3.7.2, BIRT now provides an OSGi and a POJO Runtime.

    //config.setEngineHome( "C:\\birt-runtime-2_6_2\\birt-runtime-2_6_2\\ReportEngine" );
    config.setLogConfig("c:/temp", Level.FINE);

    Platform.startup( config );
    //If using RE API in Eclipse/RCP application this is not needed.
    IReportEngineFactory factory = (IReportEngineFactory) Platform
            .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
    IReportEngine engine = factory.createReportEngine( config );
    engine.changeLogLevel( Level.WARNING );
}catch( Exception ex){
    ex.printStackTrace();
}
// Run reports, etc.
...

// destroy the engine.
try
{
    engine.destroy();
    Platform.shutdown();
    //Bugzilla 351052
    RegistryProviderFactory.releaseDefault();
}catch ( EngineException e1 ){
    // Ignore
}


来源:https://stackoverflow.com/questions/3598753/birt-without-osgi-framework

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!