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)
Image resource not available when report in subfolder
Max Bo
<p>Hi,</p><p> </p><p>I have got a project, where all my rptdesign files and image files are stored at the top level of the project folder. I have placed some images in the reports and selected them as "Image file in shared resources".</p><p> </p><p>When I am now copying the report files in a sub folder and render them as HTML preview, everything is fine and the images are shown. But when I am rendering the reports on my Tomcat server, the link to the images is broken.</p><p> </p><p>The XML of the report says for the image </p><pre class="_prettyXprint"><expression name="uri" type="constant">image.jpg</expression></pre><p>I guess, that is the reason why it is not rendered in the deployed version.</p><p>When I am placing a copy of the image file in the sub folder, it gets rendered just fine.</p><p> </p><p>But now I am asking: is there a way to avoid this and always link to the one image file without having to copy it everywhere?! The same applies for my CSS file as well, by the way.</p><p> </p><p>Thanks for any hint!</p><p> </p><p>Max</p>
Find more posts tagged with
Comments
micajblock
<p>You should set up a resource folder. I think it is done in the BIRT engine start up.</p><p> </p><p>See this post.</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/16112-resource-folder/'>http://developer.actuate.com/community/forum/index.php?/topic/16112-resource-folder/</a></p>
;
Max Bo
<p>Ok, but how do I manage the aspect, that I am accessing several different BIRT projects in the same viewer and each one has different resources or having the same resource files by name but different content?</p>
micajblock
<p>So you have lets say two images named image.jpg but are different images?</p>
micajblock
<p>If the above is the case you can have sub-folders off the root of the resource folder (or use different names).</p>
Max Bo
<p>I have for example a language_en_US.properties file with different content for each project. And if I have sub-folders, how do I tell the BIRT Viewer which sub-folder is valid for what project?</p>
micajblock
<p>Can you explain why you would not name the properties file differently? For example for project1 the properties file is project1.properties and for project 2 the properties file is project2.properties?</p>
Max Bo
<p>Because I am copying the rptdesign files from one project to the other and if I had the files named different I would have to reassign them every time.</p>
micajblock
<ul class='bbcol decimal'><li> <blockquote class="ipsBlockquote" data-author="Max Bo" data-cid="127300" data-time="1397229252"><br />
<div> <p>Because I am copying the rptdesign files from one project to the other and if I had the files named different I would have to reassign them every time.</p> </div> </blockquote> <p>Why is this a problem? This is the way Java works with properties files. Just because you copy files from one project to another you cannot expect BIRT to change the way Java works. You have these choices:</p> </li><li>One property file per project with different names. </li><li>One property file for all projects and include in the file all the value pairs for all projects. </li><li>One property file per project with same name. In this case you need to put the property file in a different sub-folder off the root of the resource folder. </li></ul>
Max Bo
<p>Sorry, but somehow I am a little bit lost here. I think option 3 is the one for me, but I am not sure how to set it up exactly in the report designer and the BIRT WebViewer on the Tomcat server.</p><p> </p><p>Could you please give me another hint here?</p>
micajblock
<p>In the designer. the project root is also the root of the resource folder (if you use defaults). So create a sub-folder int he project directory with the project name and put your resources there. Note when you add an image or a properties file the will be a folder name in front of the file name.</p><p>Then you do the same on the tomcat server. Under the folder you assign as the resource folder you create sub-directories.</p><p> </p><p>Hope this helps.</p><p> </p><p>P.S. I think option 1 is your better choice as it will avoid any conflicts.</p>
Max Bo
<p>Thanks, finally managed to get back to this one - placing the resource folder at the BIRT viewer folder works pretty good for me, thanks for the tip!
</p><p> </p><p>If anyone is interested, this link was also helpful: <a data-ipb='nomediaparse' href='
http://birtworld.blogspot.com/2010/09/birt-image-report-item.html?_sm_au_=i6HDJ87CsrCVp55P'>http://birtworld.blogspot.com/2010/09/birt-image-report-item.html?_sm_au_=i6HDJ87CsrCVp55P</a></p>
;