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)
How can I correctly write a path for Engine.openReportDesign?
p.gonzales
<p>/somewhat resolved on third post</p>
<p> </p>
<p>How can I correctly write a path for Engine.openReportDesign?<br><br>
I am getting this error::<br>
org.eclipse.birt.report.engine.api.EngineException: The design file web/reports/test.rptdesign can not be found.<br><br>
I am using glassfish in a .war file, I did put the test.rptdesign in web/reports/test.rptdesign. web is in the root of the .war file. So I don't know why birt can't find the file when I use re.openReportDesign("web/reports/test.rptdesign");</p>
Find more posts tagged with
Comments
p.gonzales
<p>Update::</p>
<p> </p>
<p>I checked it with an absolute url ala :c://...//test.rptdesign" And it opens fine. But still I would prefer to use a url that is relative to the .war file. Any suggestions?</p>
p.gonzales
<p>/resolved</p>
<p> </p>
<p>I followed this thread <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/30548-integration-birt-report-into-web-application-and-deploy-jboss-server/'>http://developer.actuate.com/community/forum/index.php?/topic/30548-integration-birt-report-into-web-application-and-deploy-jboss-server/</a></p>
;
<p> </p>
<p>In case someone googles this thread the solution is.</p>
<p> </p>
<p>import javax.servlet.ServletContext; </p>
<p> </p>
<p>Then ServletContext sc = request.getSession().getServletContext();</p>
<p>String reportName = "test.rptDesign";</p>
<p> </p>
<p>re.openReportDesign( sc.getRealPath("/reports")+"/"+reportName ); (Where re is the reportEngine instructions for setting that up are in the book Integrating and extending birt 3rd edition) </p>
p.gonzales
<p>But, if there is a better way to achieve the goal I would definitely like to hear any suggestions. Since this is dependant on HTTPServletRequest.</p>