Skip to main content



      Home
Home » Archived » BIRT » showing chart with Birt RE API
showing chart with Birt RE API [message #1063004] Tue, 11 June 2013 13:39 Go to next message
Eclipse UserFriend

I am using BIRT RE API to generate a html report with chart. I am running birt in my custom web application on a tomcat server, and i have a apache web server in front.

I have problems getting my heading around how to show the chart. What is the easiest/best practive way to show the chart image in the report ?

cant understand how to use and set base image url and imagedirectory on htmlrenderoption?

this example code under shows the report but not the chart....is there any documentation or easy example ?


IReportRunnable runnable = reportEngine.openReportDesign(rptdesign);
IRunAndRenderTask runAndRenderTask = reportEngine.createRunAndRenderTask(runnable);
runAndRenderTask.setParameterValues(discoverAndSetParameters(runnable, request, reportEngine));

HTMLRenderOption htmlRenderOption = new HTMLRenderOption();
htmlRenderOption.setOutputFormat(format);
htmlRenderOption.setOutputStream(response.getOutputStream());
htmlRenderOption.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
//htmlRenderOption.setImageHandler(new HTMLServerImageHandler());
//htmlRenderOption.setBaseImageURL(request.getContextPath() + "/images");
//htmlRenderOption.setImageDirectory(sc.getRealPath("/images"));

[Updated on: Tue, 11 June 2013 13:43] by Moderator

Re: showing chart with Birt RE API [message #1063034 is a reply to message #1063004] Tue, 11 June 2013 16:45 Go to previous messageGo to next message
Eclipse UserFriend
Have a look at this devshare it has quite a few examples using the BIRT API. There should be one in there that shows how to display a chart in a webapp.
Re: showing chart with Birt RE API [message #1063046 is a reply to message #1063004] Tue, 11 June 2013 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Where do you define sc? Do you have this above in your code?

ServletContext sc = request.getSession().getServletContext();

If so, that looks right. You could always test with a static location for the image directory, like:

options.setBaseImageURL("images");
options.setImageDirectory("E:/JBoss/jboss-as-7.1.1.Final/standalone/deployments/JSF_JBoss.war/images");

EDIT: Oops, had this post open before Kris answered, so I didn't see he had responded. Smile

[Updated on: Tue, 11 June 2013 17:32] by Moderator

Re: showing chart with Birt RE API [message #1063239 is a reply to message #1063004] Wed, 12 June 2013 15:10 Go to previous message
Eclipse UserFriend
thanks guys, i got it to work Smile
Previous Topic:Blank page on IE but in Chrome is working
Next Topic:birt chart not show
Goto Forum:
  


Current Time: Wed Mar 19 11:55:22 EDT 2025

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

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

Back to the top