Home
Analytics
Birt_home
manstein
Hi all,
I want to create a BIRT reportEngine programmatically from a java program in eclipse. (more specifically, its an eclipse plugin).
All the BIRT plugins are properly loaded etc, and i can launch the birt report designer by running the app.
What is the value of BIRT_HOME in this case? I am not using the birt runtime directly, rather i am using the birt plugins themselves.
Here is the code i am using to start up birt:
IReportEngine engine=null;
EngineConfig config = new EngineConfig;
config.setBIRTHome(?../ReportEngineProject");
try{
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine( config );
} catch ( Exception ex){
ex.printStackTrace();
}
</code>
Basically what i want to do is to open a design template from within the program and emit it.
Thanks a lot!
Find more posts tagged with
Comments
mwilliams
Hi manstein,<br />
<br />
Since the platform class is static and you have the BIRT plugins in your app already, the platform is technically already started. Therefore, you can probably use something like this instead to start the engine:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
EngineConfig config = new EngineConfig();
// Create the report engine
IReportEngineFactory factory = (IReportEngineFactory) org.eclipse.birt.core.framework.Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
</pre>
<br />
This should do it for you since you already have all the plug-ins running.<br />
<br />
Hope this helps.
yusufnazir
Hi Manstein,
Did you get the application to work?
I'm sitting with the same problem.
Would really appreciate your input.
thanks in advance
Yusuf