Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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
nari noori is currently offline nari noori
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 13: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 16:45 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher Clark
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 17:30 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1546
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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.

[Updated on: Tue, 11 June 2013 17: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 15:10 Go to previous message
nari noori is currently offline nari noori
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: Mon Jul 28 06:19:57 EDT 2014

Powered by FUDForum. Page generated in 0.01565 seconds