Home
Intelligence (Analytics)
Images relative in HTML report
locutuz
Hello everybody,
I have a stand-alone report application, that generates HTML-reports and stores it to a specified location.
Therefore I have a special directory-structure, e.g.:
C:\temp\output // main output folder
MyReport.html
C:\temp\output\resources // contains images
MyImage01.png
When I open the generated HTML file I see that the "src"-attribute of the IMG-tag references the file in an absolute way:
<img src="file:/C:/temp/output/resources/MyImage01.png"></img>
This is not good, because so the report can only be shown on a system where the directory structure is identical!
What I want is a relative reference like this:
<img src="file:./resources/MyImage01.png"></img>
The absolute part is replaced by the '.' that points to the current directory.
Is it possible to configure the ReportEngine in that way?
Unfortunately I didn't find an answer in the BIRT-books or the internet.
Thanks for your help!
Regards,
Sebastian
Find more posts tagged with
Comments
mwilliams
So, you're using an image element with the URI option? Also, what is your BIRT version?
locutuz
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="107523" data-time="1343193334" data-date="24 July 2012 - 10:15 PM"><p>
So, you're using an image element with the URI option? Also, what is your BIRT version?<br /></p></blockquote>
<br />
No, the image is contained with the option "Image file in shared resources".<br />
My installed BIRT version is 3.7.1
locutuz
Does nobody know a solution?
mwilliams
Sorry your post got skipped over. Sometimes I lost track of posts I'm working on. Can you create a simple java file to run a report with an image, how you're currently doing it, so I can test on it? Thanks.
locutuz
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108520" data-time="1344972601" data-date="14 August 2012 - 12:30 PM"><p>
Sorry your post got skipped over. Sometimes I lost track of posts I'm working on. Can you create a simple java file to run a report with an image, how you're currently doing it, so I can test on it? Thanks.<br /></p></blockquote>
<br />
<br />
Hi Michael,<br />
<br />
thanks for your reply. I just looked over the code to arrange an example that you can test.<br />
I think I found the problem. It is within the code that configures and triggers the report generation.<br />
<br />
The path for the image directory to set in the HTMLRenderOption was generated absolutely instead of relative.<br />
After changing this, the images on the report are included relatively.<br />
<br />
However I appreciate the help I got here.<br />
Thank you.<br />
<br />
Regards,<br />
Sebastian