コード例 #1
0
ファイル: BirtProvider.java プロジェクト: wangqi/openreports
  @SuppressWarnings("unchecked")
  public static synchronized void startBirtEngine(IPlatformContext context) {
    log.info("Starting BIRT Engine and OSGI Platform using: " + context.getClass().getName());

    HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();

    HTMLRenderOption emitterConfig = new HTMLRenderOption();
    emitterConfig.setActionHandler(new HTMLActionHandler());
    emitterConfig.setImageHandler(imageHandler);

    EngineConfig config = new EngineConfig();
    config.setEngineHome("");
    config.setPlatformContext(context);
    config.setLogConfig(null, Level.ALL);
    config.getEmitterConfigs().put("html", emitterConfig);

    try {
      Platform.startup(config);
    } catch (BirtException e) {
      log.error("BirtException", e);
    }

    IReportEngineFactory factory =
        (IReportEngineFactory)
            Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);

    birtEngine = factory.createReportEngine(config);

    log.info("BIRT Engine Started");

    birtEngine.changeLogLevel(Level.SEVERE);
  }
コード例 #2
0
ファイル: BirtInstance.java プロジェクト: rmancher/kc
 public void init() throws BirtException {
   config = new EngineConfig();
   Platform.startup(config);
   IReportEngineFactory factory =
       (IReportEngineFactory)
           Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
   engine = factory.createReportEngine(config);
   engine.changeLogLevel(java.util.logging.Level.WARNING);
 }
コード例 #3
0
  private void init() {
    engineConfig = new LauncherEngineConfig();

    IReportEngineFactory factory =
        (IReportEngineFactory)
            Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);

    configEngine();
    this.engine = factory.createReportEngine(engineConfig);
    engine.changeLogLevel(Level.WARNING);
  }
コード例 #4
0
  static {
    final EngineConfig config = new EngineConfig();
    config.setEngineHome(EMPSettings.birt_home);
    config.setResourcePath("reports/images");
    try {
      // 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);
      engine = factory.createReportEngine(config);
      engine.changeLogLevel(Level.SEVERE);

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }