Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » showing chart with Birt RE API
showing chart with Birt RE API [message #1063004] Tue, 11 June 2013 17:39 Go to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member

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 17:43]

Report message to a moderator

Re: showing chart with Birt RE API [message #1063034 is a reply to message #1063004] Tue, 11 June 2013 20:45 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
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 21:30 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

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


Michael

Developer Evangelist, Silanis

[Updated on: Tue, 11 June 2013 21:32]

Report message to a moderator

Re: showing chart with Birt RE API [message #1063239 is a reply to message #1063004] Wed, 12 June 2013 19:10 Go to previous message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
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 Apr 24 14:54:35 GMT 2024

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

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

Back to the top