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)
BirtEngineFactory openReportDesign file not found
LauraHdn
<p>Hello,</p>
<p>I'm able to openReportDesign and generate a Birt Report using a hard-coded path name:</p>
<p> </p>
<p>rptDesignInput = this.getClass().getResourceAsStream("/resources/report/design/db/DailyRBSFXRate.rptdesign");</p>
<p>try{</p>
<p>design=engine.openReportDesign(rptDesignInput);</p>
<p><run and render the report></p>
<p>...</p>
<p> </p>
<p>but openReportDesign fails when the path name is not hard-coded:</p>
<p><retrieve path from database into ResultSet rs></p>
<p>String x = rs.getString("<path_name>");</p>
<p>rptDesignInput = this.class().getResourceAsStream("\"/" + x + "\"");</p>
<p>logger.info("\"/" + x + "\"");</p>
<p> </p>
<p>logger display:</p>
<p>"/resources/report/design/db/DailyRBSFXRate.rptdesign"</p>
<p> </p>
<p>Hopefully there are no typos as I can't seem to cut and paste here...but the logger display and the hard-coded path name are exactly the same. I've also stored the reformatted string into a variable and used that with the same results.</p>
<p> </p>
<p>Does anyone have an idea on why the results would be different?</p>
<p> </p>
<p>Thanks,</p>
<p>Laura</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
Clement Wong
<p>Do you need to double quote the string at the beginning and end? It appears extraneous.</p>
<p> </p>
<p>rptDesignInput = this.class().getResourceAsStream("/" + x);</p>