Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT Charts Issue
karthikr
Hi,
I am relatively a newbie to BIRT and am hoping that the experts on this forum can help in resolving my issue.
I am using RE API to generate a BIRT report which includes charts. I use ImageServerHandler after looking at some of the examples in the forum.
I am able to see the temporary image that BIRT Creates for the charts in my local file system but my websphere application is installed outside the <Websphere> Install directory and it does not support Hot Deployment. So i have to restart the websphere application to see the newly created temporary image.
Can anyone please let me know if it is possible to render the chart without creating the temporary image file on the local file system. Can you please point me to an example which would accomplish the same ?
Would it be more efficient ?
Thanks and Regards
Karthik
Find more posts tagged with
Comments
karthikr
Just wanted to post my code snippet
IRunAndRenderTask task = reportEngine
.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setOutputStream(response.getOutputStream());
options.setImageHandler(new HTMLServerImageHandler());
options.setImageDirectory(sc.getRealPath("/report/images");
options.setBaseImageURL(request.getContextPath() + "/report/images");
options.setHtmlPagination(false);
options.setEmbeddable(true);
options.setSupportedImageFormats("JPG;PNG;BMP;SVG;GIF");
task.setRenderOption(options);
task.run();
task.close();
My .RPTDesign file has both Charts and dataGrids, Can someone let me know if it is necessary to use ChartEngine APIs for this requirement ?
If that is the case, How can i Use RE APIs and CE APIs to render one single .rptdesign file ?
JasonW
Karthik,
Can you post the url of the image once it is created? Just render to html and then view source and post the img src tag. Do you have any location you could create the images on the fly on the app server that would allow url access to?
Jason
karthikr
Hi Jason, <br />
<br />
Thanks for your reply, Please see below the URL of the IMG <br />
<br />
<a class='bbc_url' href='
http://localhost:11080/report/images/custom307a307a125fe90aadb1'>http://localhost:11080/report/images/custom307a307a125fe90aadb1</a><br
/>
<br />
I see the file also under the real directory where this URL is pointing to. <br />
<br />
Is there any other way of rendering the chart without creating the temporary image on the file system. <br />
<br />
Thanks<br />
Karthik
karthikr
Hi,
Just did some more investigation on this. Basically it could be a problem with OSGi
We are setting the ImageDirectory to a directory which is the location of the bundle and we even see the image getting created in this location, but when we use the URL to serve the image, OSGi is actually serving it up from the Bundle Cache which is a directory like ths
tmp/<war File Name>/eclipse/configuration/org.eclipse.osgi/bundles/......
So i think basically we have to expose some directory in ImageDirectory outside OSGI which is write enabled as well as has the ability to be accessed by Http.
If i Do this, What will happen to the static Images which is used in BIRT Reports ?
Any ideas or thoughts on the same.
JasonW
You can write your own image handler, but I do not see how it will help in this case. Take a look at HTMLServerImageHandler.java from the source to see what it does for more info. Using the RE API you can set your own image handler.
You will need to cleanup the images somehow. The Viewer cleans them up with a Context listener.
Jason