Skip to main content



      Home
Home » Archived » BIRT » Setting relative url for images
Setting relative url for images [message #247644] Thu, 12 July 2007 12:10 Go to next message
Eclipse UserFriend
Originally posted by: weisswieschwarz.gmx.net

Hello,

I set up the Servlet Example to use the RE API.
It works quite well, but the Charts only get displayed with IE.

I think Firefox has a problem with displaying the absolute URLs of the
Chart-Images. (It gets displayed correctly when I change the urls manually)

I tried to set a relative url by using:
renderContext.setBaseImageURL("/images");
but this didn't work.
(In the HTML-Source there's still an absolute URL)

How can I get an HTML output with a relative url for my images?

Thanks a lot
Karin
Re: Setting relative url for images [message #247659 is a reply to message #247644] Thu, 12 July 2007 12:56 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Karin,

If you are using BIRT 2.2 try the following:

HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat("html");
options.setImageHandler(new HTMLServerImageHandler());
options.setImageDirectory(sc.getRealPath("/images"));
options.setBaseImageURL(req.getContextPath()+"/images");

options.setOutputStream(resp.getOutputStream());
task.setRenderOption(options);

The key is to use the HTMLServerImageHandler class;

Jason

Karin wrote:
> Hello,
>
> I set up the Servlet Example to use the RE API.
> It works quite well, but the Charts only get displayed with IE.
>
> I think Firefox has a problem with displaying the absolute URLs of the
> Chart-Images. (It gets displayed correctly when I change the urls manually)
>
> I tried to set a relative url by using:
> renderContext.setBaseImageURL("/images");
> but this didn't work.
> (In the HTML-Source there's still an absolute URL)
>
> How can I get an HTML output with a relative url for my images?
>
> Thanks a lot
> Karin
>
Previous Topic:Example on Crosstab
Next Topic:Unable to set y-axis scale dynamically - Please help
Goto Forum:
  


Current Time: Sat May 10 16:23:18 EDT 2025

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

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

Back to the top