【问题标题】:BIRT without OSGi framework没有 OSGi 框架的 BIRT
【发布时间】:2010-08-30 07:58:47
【问题描述】:

您好,我们目前正在尝试将 BIRT 集成到我们的桌面独立应用程序中,使用来自 here 的示例。

问题是——如何避免使用 OSGi 框架。我们能否将所有必需的库和插件放入生成的 EAR 中,而无需将报告引擎设置为主页?因为我们的客户不会因为不得不下载额外的运行时而感到高兴。真的需要这么大的运行时间吗(我猜大约 100 兆字节)。

【问题讨论】:

  • 是的,我们做了 - 更喜欢使用其他东西
  • 你们最后用了什么?
  • 只使用 Jasper Report 和我们自己的框架

标签: java birt


【解决方案1】:

从Birt 3.7开始,你可以使用Birt POJO Runtime(你可以查看the Birt website)。

您唯一要做的就是不要致电EngineConfig.setEngineHome(engineHome)

如果您关注the Birt website,您的代码将如下所示:

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
}

【讨论】:

    【解决方案2】:

    抱歉,如果不运行 OSGi,确实无法运行 BIRT 报告。如果您不使用它们,可以修剪一些模块。例如,可以删除图表,但图表将不起作用。显然,您可以删除示例数据库以及支持它的 derby 插件。

    在那些明显的项目之后,删除插件变得更加困难。

    【讨论】:

      猜你喜欢
      • 2010-12-17
      • 1970-01-01
      • 1970-01-01
      • 2011-10-27
      • 2011-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      相关资源
      最近更新 更多