Skip to main content



      Home
Home » Archived » BIRT » path for image reference
path for image reference [message #689825] Tue, 28 June 2011 08:46 Go to next message
Eclipse UserFriend
Hi,

I have the following reference in a text control:

<img id="twistyImg_08" src="WebContent/report/images/CollapseInfoIcon.gif"

This works fine during development when I display the report in the viewer, however when the report is deployed to the server, the server can no longer find the image. I believe the "WebContent" part of the path is not required during deployment but is required in the development environment.
How can I make it so that the image works in both scenarios?

Thanks,
Mike
Re: path for image reference [message #689944 is a reply to message #689825] Tue, 28 June 2011 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Mike

Can you try something like the following in your text element:
<div id="testimg">
<img id="myimg"
src=<VALUE-OF>reportContext.getHttpServletRequest().getContextPath()
+"/webcontent/birt/images/Go.gif"</VALUE-OF> alt="my alt text" />
</div>

Hopefully you will not need it but you can check if you are in the
designer like:
if(
reportContext.getHttpServletRequest().getAttribute("attributeBean").isDesigner()
){

BTW not sure if you read this but look at this post on images:
http://birtworld.blogspot.com/2010/09/birt-image-report-item.html

Jason

On 6/28/2011 8:46 AM, Mike Wulkan wrote:
> Hi,
>
> I have the following reference in a text control:
>
> <img id="twistyImg_08" src="WebContent/report/images/CollapseInfoIcon.gif"
>
> This works fine during development when I display the report in the
> viewer, however when the report is deployed to the server, the server
> can no longer find the image. I believe the "WebContent" part of the
> path is not required during deployment but is required in the
> development environment.
> How can I make it so that the image works in both scenarios?
>
> Thanks,
> Mike
Re: path for image reference [message #690370 is a reply to message #689944] Wed, 29 June 2011 08:52 Go to previous message
Eclipse UserFriend
When I output the value of

reportContext.getHttpServletRequest().getContextPath()

when running in the designer I just get

/viewer

which doesn't help. I'll try the other method and read that link you sent me.
Previous Topic:Unique Count
Next Topic:Hide parameters on fly (e.g. hide those have only one value)
Goto Forum:
  


Current Time: Wed Jul 02 21:00:35 EDT 2025

Powered by FUDForum. Page generated in 0.04946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top