Home
Developing Analytics Applications
Java integration. Not able to link with Data Objects
Migrateduser
<p>Hello,</p>
<p> </p>
<p>I'm using actuate birt runtime and platform to set up a simple junit test to run the engine report. I am able to generate html from my report design. But when I try to link my report desing with an report object, I always getting the same error:</p>
<p><span style="color:rgb(255,0,0);font-family:Arial;font-size:13.3333px;">Failed to find out data source of data set "BETMANDMODUL_FINANCE".</span></p>
<p> </p>
<p>This is how I run report engine:</p>
<pre class="_prettyXprint _lang-nocode">
IRenderOption render = new HTMLRenderOption();
System.setProperty("RUN_UNDER_ECLIPSE", "false");
EngineConfig config = new EngineConfig();
//C:\OpenText\InformationHub\modules\BIRTiHub\iHub\web\birtservice\WEB-INF\platform
config.setBIRTHome(BIRT_HOME);
config.setLogConfig(LOGS_PATH, Level.ALL);
// important for BIRT to know resources
config.setResourcePath(REPORTS_RESOURCES_PATH);
// Default Render Option
config.setDefaultEmitter("html", render.getEmitterID());
render.setOutputFormat("html");
try{
Platform.startup(config);
}catch(BirtException e){
e.printStackTrace();
}
IReportEngineFactory engineFactory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
IReportEngine engine = engineFactory.createReportEngine(config);
IReportRunnable design = null;
try {
design = engine.openReportDesign(new FileInputStream(reportDesignPath));
} catch (EngineException | IOException e) {
e.printStackTrace();
}
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, TestReport.class.getClassLoader());
String outputFilename= getOutputName(reportDesignPath);
render.setOutputFileName(outputFilename);
// set the render option
task.setRenderOption(render);
try {
// runs the report and generate output.
task.run();
// close the report.
task.close();
}catch(EngineException e){
e.printStackTrace();
}
</pre>
<p>I built the reportdesign with Birt designer professional 4.4 and from the IDE it's working.</p>
<p> </p>
<p>Can anyone help me?</p>
<p> </p>
<p>Thank you very much.</p>
Find more posts tagged with
Comments
There are no comments yet