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)
Resource folder images and data set parameter bindings
JDRoe
<p>Hi,</p><p> </p><p>I am trying to display an image located in the shared resources based on the results of a DB query.</p><p> </p><p>The Data Set that the image is bound to is set. However this Data Set has parameter bindings that are dependent on another database result. I have those bindings set correctly as they work if I am simply displaying a text field, but when I change it to an image I get an error.</p><p>This is what I have defined for the "Image file in shared resources" option:</p><p> </p><div><pre class="_prettyXprint">if (row["RESULT"] == "PASS"){"pass.png";} else if (row["RESULT"] == "FAIL"){"fail.png";} else if (row["RESULT"] == "SKIP"){"skip.png";}</pre></div><div> </div><div>but I am getting this error when the report is being rendered:</div><div><pre class="_prettyXprint">Caused by: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report. at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2363) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:191) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:937) ... 38 moreCaused by: java.lang.IllegalArgumentException at sun.net.www.ParseUtil.decode(Unknown Source) at sun.net.www.protocol.file.Handler.openConnection(Unknown Source) at sun.net.www.protocol.file.Handler.openConnection(Unknown Source) at java.net.URL.openConnection(Unknown Source) at java.net.URL.openStream(Unknown Source)</pre></div><div>Any help would be appreciated!</div>
Find more posts tagged with
Comments
micajblock
<p>Where are the images located?</p>
JDRoe
<p>they are located at the same level of the .rptdesign file. The resource folder location is set to <Current Project Folder></p>
micajblock
<p>Should work. There is something else that is wrong. can you reproduce using classic models so we can check it out?</p>
JDRoe
<p>will do, do you want me to send you the .rptdesign file that is generated when I finish?</p>
micajblock
<p>Just upload it here (you can do this when you click on 'More Reply Options'). BTW, what version of BIRT are you using?</p>
JDRoe
<p>Ok - I was able to re-create the problem using the ClassicModels Datasource. I've also attached the png image that I am testing with.</p><p> </p><p>Hopefully you will be able to figure it out
</p>
micajblock
<p>The error is because you need an else for all other cases. Attached is a design that works.</p>
JDRoe
<p>Thank you mblock! That was indeed it. So chaning my image javascript to this worked:</p><p>
</p><div><pre class="_prettyXprint _lang-js">if (row["RESULT"] == 'PASS') { 'pass.png';} else if (row["RESULT"] == 'FAIL') { 'fail.png';} else { 'skip.png';}</pre></div>