Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Error in an application integrating report engine
Mad1s0n
Hi all,<br />
I am currently integrating the report engine into a client/server application. The engine is on the server side and is due to send reports as byte arrays towards the client which will open them.<br />
Using Maven, I uploaded the Birt libraries onto the maven repository and set the BIRT_HOME to a location on my machine for test purpose which is obviously different from the maven repo.<br />
The app compiles, but when launching the report, an exception occurs at the engine.openReportDesign("") level. The thing is that when launching the report with the same BIRT_HOME and the ReportEngine in the classpath (thus no maven) from a simple project, the report is generated.<br />
I sense that this is a version problem, but I don't know where to look. Some insight would be most welcome.<br />
<br />
Thanks! <br />
<br />
the code that launches the report:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
EngineConfig config = new EngineConfig();
config.setBIRTHome("C:\\Documents and Settings\\sco\\Bureau\\birtruntime\\ReportEngine");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
IReportEngine engine = factory.createReportEngine(config);
IReportRunnable design = engine.openReportDesign("C:\\Documents and Settings\\sco\\Bureau\\birtruntime\\ReportEngine\\samples\\customers.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
task.setParameterValue("languageParameter", language);
PDFRenderOption options = new PDFRenderOption();
options.setOutputStream(bos);
options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
Platform.shutdown();
} catch(Exception e) {
e.printStackTrace();
}
return bos.toByteArray();
</pre>
<br />
And the exception:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
10 f?vr. 2011 11:22:24 org.eclipse.birt.report.model.metadata.MetaDataReader read
GRAVE: null
java.lang.NullPointerException
at org.eclipse.birt.report.model.core.DesignElement.initSlots(DesignElement.java:2990)
at org.eclipse.birt.report.model.elements.ReportDesignImpl.<init>(ReportDesignImpl.java:82)
at org.eclipse.birt.report.model.elements.ReportDesign.<init>(ReportDesign.java:52)
at org.eclipse.birt.report.model.parser.DesignParserHandler.<init>(DesignParserHandler.java:49)
at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:86)
at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:315)
at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:294)
at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:158)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:255)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:274)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:196)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:130)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:295)
</pre>
Find more posts tagged with
Comments
There are no comments yet