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)
Problem with loading images
mukulobj
Dear Birt Programmers ,
I am trying to integrate BIRT RE in OSGi application and able to generate HTML and PDF reports. However, I am facing problems while loading the images.
I am trying to invoke ReportEngine from within OSGi and my images are kept inside WbContent/images/ directory.
Upon investigation, I found that I need to set the ImageBaseURl and ImageDirectory.
If I try to set them using:
options.setImageHandler(new HTMLServerImageHandler()); options.setBaseImageURL(req.getContextPath()+"/images"); options.setImageDirectory(sc.getRealPath("/images"));
I get following error: Image Dir not set !
If I try to set them using:
HTMLRenderContext renderContext = new HTMLRenderContext(); renderContext.setBaseImageURL(req.getContextPath()+"/images"); renderContext.setImageDirectory(sc.getRealPath("/images"));
I get following error:
Unknown URL: /myContext/images/fileca1a93125df80ce0a2.png
PS. The actual image name is set in Report Design File as <expression name="uri">"images/arrowleft.png"</expression>
But the error message names it as "fileca1a93125df80ce0a2.png"
Any help is appreciated.
Thank you very much
Mukul
Find more posts tagged with
Comments
mukulobj
For now, I am able to get rid of my first issue i.e. <br />
"Image Dir not set !"<br />
<br />
But second issue still remains, images are not being loaded and somehow image file names are being changed to some arbitrary names i.e.<br />
<br />
Unknown URL: <br />
/myContext/images/<strong class='bbc'>fileca1a93125df80ce0a2.png</strong><br />
<br />
Does anybody have any idea how to solve this issue?<br />
<br />
Regards<br />
Mukul