Hi all,
I am new to BIRT and trying to generate a Excel report using the Tribix xls emitter. But somehow I am not able to get it working. Following is what I did :
1) I downloaded the jars for tribix :
org.uguess.birt.report.engine.common_2.5.2.201107181644.jar
org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644.jar
2) I then extracted the contents of 'org.uguess.birt.report.engine.emitter.xls_2.5.2.201107181644.jar' file. I removed the 4 libraries from the 'lib' folder. My lib folder was empty after this. I repackaged the remaining contents in a jar file with the same name.
3) I copied all the 6 jar files to my lib folder where my 'org.eclipse.birt.runtime_3.7.2.v20120214-1408.jar' is also present. I changed the code to provide the EMITTER ID for the tribix XLS emitter.
options.setOption(IRenderOption.EMITTER_ID, "org.uguess.birt.report.engine.emitter.xls");
4) When I ran a report, I got the error :
org.eclipse.birt.report.engine.api.EngineException: EmitterID org.uguess.birt.report.engine.emitter.xls for render option is invalid.
5) To fix this problem , I followed the link : birt-exchange.org/org/forum/index.php/topic/22708-tribix-emitters-in-birt-3-7/
I basically extracted the contents of file 'org.eclipse.birt.runtime_3.7.2.v20120214-1408.jar' and modified the plugin.xml file to comment out the default xls emitter <extension> part. I then deleted eveything from my 'META-INF' folder except MANIFEST file. I basically deleted files eclipse.inf and .DS_Store. I changed MANIFEST file and my MANIFEST file now has :
Manifest-Version: 1.0
Bundle-Vendor: Eclipse.org
Bundle-Version: 3.7.2.v20120214-1408
Bundle-Name: BIRT Runtime SDK
Bundle-SymbolicName: org.eclipse.birt.runtime
I repackaged the contents into jar and copied the jar to 'lib' folder.
6) When I run the report now, I get a NPE exception.
The code where I get it is :
EngineConfig config = new EngineConfig();
config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
Thread.currentThread().getContextClassLoader());
config.setEngineHome("");
try {
Platform.startup(config);
} catch (BirtException e) {
logger.error("BIRT exception encountered " + e);
e.printStackTrace();
}
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);
}
Basically Platform.createFactoryObject() returns a 'null' resulting in a NPE.
Apologies for the long post. Could someone kindly take a look and let me know what is that I am missing here.
Thanks in advance.
Regards
Madhulika
[Updated on: Fri, 22 February 2013 06:33] by Moderator