Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » path for image reference
path for image reference [message #689825] Tue, 28 June 2011 12:46 Go to next message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
Registered: July 2009
Senior Member
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 15:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 12:52 Go to previous message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
Registered: July 2009
Senior Member
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: Fri Apr 19 03:53:18 GMT 2024

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

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

Back to the top