Home
Analytics
Problems finding .rptdesign file
tapani108
Hello, Hello, <br />
<br />
I am quite new to BIRT and experiencing problems integrating BIRT into my application. I have created, using examples from the Integrating BIRT book, the required classes. The initialization of IReportEngine seems to be successful, but for some reason the report design file is either not found or not parsed properly.<br />
<br />
I have successfully created the report design file and it shows up on the Eclipse preview nicely, so there shouldn't be any problems with the design file itself.<br />
<br />
<br />
Below is the code for initializing the engine and opening the .rptdesign file:<br />
<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IReportEngine visitReportEngine = BIRTEngine.getBirtEngine(getServletContext());
// Configure the engine and render options
EngineConfig reportEngineConfig = visitReportEngine.getConfig();
HTMLRenderOption renderOptions = new HTMLRenderOption();
renderOptions.setImageHandler(new HTMLServerImageHandler() );
renderOptions.setImageDirectory("http://www.birt-exchange.org/forum/images/BIRTImages");
renderOptions.setBaseImageURL(ServiceRoot +"http://www.birt-exchange.org/forum/images/BIRTImages");
reportEngineConfig.setEmitterConfiguration(RenderOptionBase.OUTPUT_FORMAT_HTML, renderOptions);
// Attempt to open report design file.
String designName = "/BIRTDesignFiles/week.rptdesign";
IReportRunnable runnable = null;
try {
runnable = visitReportEngine.openReportDesign(designName);
} catch (EngineException e)
{
System.err.println("Design "+ designName + " not found.");
visitReportEngine.destroy();
}
</pre>
<br />
The NullPointerException I get from this is:<br />
<br />
<blockquote class='ipsBlockquote' ><p>
<br />
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:349)<br />
<br /></p></blockquote>
<br />
I presume the file is found (since I get a clear "not found" error message when using other paths).<br />
<br />
I'm not sure I'm actually finding the design file. Since I don't have the attached source, I can't really tell what path is being sent to openReportDesign(). Can someone please enlighten me?
Find more posts tagged with
Comments
JasonW
Can you try using the full path to the design?
Jason
tapani108
Yes, I used the full path, and aamof that was not the problem. The problem was that IReportEngine was not re-initialized properly after destroy(), and was therefore causing the NullPointerException in GetReportDesign.
Thanks for your reply!
/T