Home
Analytics
Dynamic Image in Shared Resources
lawrence.velino
<p>Hi all,</p>
<p> </p>
<p>I'm currently having an issue concerning "dynamic" images. Presently, I am setting an image to, by script, change to one of three files stored in the shared resources folder (or, home directory of the project as I understand it). When working on my local machine, all is well and good; the image will change dynamically. Here is the script on my image:</p>
<pre class="_prettyXprint _lang-js _linenums:1">
currValue = new Number(this.getNamedExpressionValue("currVal"));
pastValue = new Number(this.getNamedExpressionValue("pastVal"));
if (currValue > pastValue){
//we increased in value
this.URI = "img_redUp.png";
}
else if (currValue < pastValue){
//we decreased in value
this.URI = "img_greenDown.png";
}
else{
//we stayed the same
this.URI = "img_doubleArrow.png";
}
</pre>
<p>The image's resource file is initially set to " \ " , and I have tested this image by pointing it at the Shared Resources folder (" \ "), as well as a Folder titled "Resources" ("\Resources\"). </p>
<p> </p>
<p>My issue here, though, is when I publish my report to iHub. I have published the images to both the default Resource folder and a location relative to the report's original shared resources folder. Neither of these work, though. I'm really confused on how to access these images when the report is launched from iHub.</p>
<p> </p>
<p>Thanks for any help!</p>
<p>Larry</p>
Find more posts tagged with
Comments
jar
<p>Hello,</p>
<p> </p>
<p>We did a dynamic image in the header of a report based on a parameter. Just add an image in your report and make it of the type dynamic. In the expression field make a calculation that results in the name-part of your image file (for us using the report parameter, define your own) and add the extension as text (.png of .jpeg).</p>
<p> </p>
<p>In this way the images must be in the resources map in your Iserver (We work with IHub 2) so I do not know if this still works in IHub 3 but I think so. </p>
<p> </p>
<p>Jar</p>
lawrence.velino
<p>Hi Jar,</p>
<p> </p>
<p>Thanks for the response!</p>
<p> </p>
<p>My issue isn't getting an image to change dynamically. It's getting the shared resource folder functionality to work properly, when the report is deployed from iHub. I had initially thought the /Resources folder of the default volume (on iHub3 server) was the sure-fire answer, but that doesn't seem to be the case. Now I'm wondering if there is some configuration error on my end, or if shared resources with images doesn't work on iHub 3?</p>
<p> </p>
<p>Best,</p>
<p>Larry</p>
Clement Wong
<p>Larry,</p>
<p> </p>
<p>They way that you have coded for the dynamic images should be picked up from your volume's /Resources folder.</p>
<p> </p>
<p>As a test, please unzip the attached and upload the .RPTDESIGN to any folder in your iHub volume. Then upload the .JPG to the volume's /Resources folder.</p>
<p> </p>
<p>If you run the report, the resulting report should show an image.</p>
lawrence.velino
<p>Clement,</p>
<p> </p>
<p>The Test report you sent to me works! I wonder; do you think the script I wrote is in the wrong scope (it's in OnCreate)? Or, should I build an expression on the image, over writing a script on it?</p>
<p> </p>
<p>Thanks,</p>
<p>Larry</p>
lawrence.velino
<p>Hi all!</p>
<p> </p>
<p>Update: For whatever reason, moving the script I posted originally from OnCreate scope to OnRender scope works, in both my local machine and on iHub. </p>
<p> </p>
<p>All the best,</p>
<p>Larry</p>
superbeda
<p>Hi Clement,</p>
<p>I have the same issue. I tried your .zip file; in the designer the report runs ok, in iHub 3.1 the image doesn't show.</p>
<p>I publish your report under "Applications/folder1/folder2/folder3/folder4/Image Test.rptdesign". I shared the image with ALL(VRE).</p>
<p>Can you help me?</p>