Hi, I want to run a report that contains a chart and then I want to display it in a jeditorpane.
The chart report has been already created using the report designer. I have been looking to some examples, but they are more about creating the chart using the chart engine. Here is what I am doing, but nothing gets displayed in the jeditorpane.
IReportRunnable design = engine.openReportDesign("report.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
options.setOutputStream(bos);
options.setSupportedImageFormats("JPG;PNG;BMP;SVG");
options.setOutputFormat("html");
options.setEmbeddable(true);
task.setRenderOption(options);
task.run();
task.close();
myEditorPane.setContentType("text/html");
myEditorPane.setText(bos.toString());
And this is how I start the report engine platform.
private static void startPlatform() {
try {
EngineConfig config = new EngineConfig();
config.setEngineHome("C:/birtruntime/birt-runtime-2_6_1/ReportEngine");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
DesignConfig designConfig = new DesignConfig();
IDesignEngineFactory iDesignEngineFactory = (IDesignEngineFactory) Platform
.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
iDesignEngineFactory.createDesignEngine(designConfig);
System.out.println("BIRT Engine Started");
} catch (Exception e) {
e.printStackTrace();
}
}
thanks in advanced