BIRT Exchange Forum: BIRT report charts are not visible in browser - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

BIRT report charts are not visible in browser Rate Topic: -----

#1 User is offline   pinargocebe Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-March 12


Posted 26 March 2012 - 10:45 AM

I am using BIRT reporting tool in my SEAM application. Also I downloaded Birt designer professional (Actuate 11SP3) to using flash charts. When I preview report in Actuate viewer, there is any error, everything is ok flash is playing and images are visible ,but when I open it in browser (IE,Mozilla or Chrome) flash charts, normal charts and images are not visible. On the other hand Lists, tables or labels are visible in browsers.

Also In deployment I receive an exception like this ;

java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory

I don't know this exception affects visibility of charts and images. How can I fix this visibility problem.

(I am using Eclipse helios, Seam 2.2, Actuate 11SP3, JBoss AS 6.0)
0

#2 User is offline   pinargocebe Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-March 12


Posted 27 March 2012 - 04:52 AM

I fixed IllegalStateException with this solution;
here
There are some changes in web.xml file in this ,but visibility problem still is going on.
0

#3 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 30 March 2012 - 08:36 AM

What runtime are you using with JBoss. Ie what birt engine?

Jason
0

#4 User is offline   paladin74 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-April 12


Posted 01 April 2012 - 07:33 AM

Hi folks,

I have a similar problem. I have written a custom servlet (see snippet below) which uses BIRT 2.6.2 to pass XML DOM stream to a report. The browser, Firefox or Opera shows nothing, when displaying the source code of the output Firefox is complete empty and Opera has simple html, header and body tags but all empty.


response.setContentType("text/html");
//response.setContentType("image/svg+xml");

String reportName = "AnalyseResult.rptdesign";
ServletContext sc = request.getSession().getServletContext();
this.birtReportEngine = TTB_BirtEngine.getBirtEngine(sc);

//ByteArrayInputStream inputStream = new ByteArrayInputStream(xmlAsWriter.toString().getBytes("UTF-8"));

//HTMLRenderContext renderContext = new HTMLRenderContext();
//renderContext.setBaseImageURL(request.getContextPath()+"/images");
//renderContext.setImageDirectory(sc.getRealPath("/images"));

HTMLRenderOption options = new HTMLRenderOption();
//options.setImageDirectory("./");
options.setImageHandler(new HTMLServerImageHandler());
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");

options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setBaseImageURL(request.getContextPath()+"/images");
options.setImageDirectory(sc.getRealPath("/images"));
//options.setEmbeddable(true);

logger.log( Level.FINE, "image directory " + sc.getRealPath("/images"));
System.out.println("stdout image directory " + sc.getRealPath("/images"));
/*
java.util.Map<String, HTMLRenderContext> contextMap =
new HashMap<String, HTMLRenderContext>();
contextMap.put
(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext);
*/
try{
IReportRunnable design;
//Open report design - sc.getRealPath gets to /opt/tomcat/webapps/web/Reports
design = birtReportEngine.openReportDesign(sc.getRealPath("/Reports"+"/"+reportName));

//create task to run and render report
IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask( design );
//task.setAppContext( contextMap );

StringWriter xmlAsWriter = new StringWriter();
StreamResult streamResult = new StreamResult(xmlAsWriter);
TransformerFactory.newInstance().newTransformer().transform(new DOMSource(xmlResponse.getDomDocument()), streamResult);
// write changes
ByteArrayInputStream inputStream = new ByteArrayInputStream(xmlAsWriter.toString().getBytes("UTF-8"));

java.util.Map appContext = task.getAppContext();
//appContext.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext);
//FileInputStream fileInputStream = new FileInputStream("D:/workspaces/birt/2.2.2/datasource/batch/reports/report.xml");
appContext.put("org.eclipse.datatools.enablement.oda.xml.inputStream", inputStream);
//Use closeInputStream (true) to let BIRT automatically close the inputStream.
appContext.put("org.eclipse.datatools.enablement.oda.xml.closeInputStream", "true");

//run report
task.setAppContext(appContext);
task.setRenderOption(options);
task.run();
task.close();
}
catch (EngineException e) {


Any help is welcome!

Regards,
Pala
0

#5 User is offline   pinargocebe Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-March 12


Posted 01 April 2012 - 10:14 PM

Hi,
I am using Birt 2.6.3 runtime and my problem stil is going on.
0

#6 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 03 April 2012 - 08:29 AM

Pinargocebe,

Can you post your code? BTW if you are using Actuate you could also look at using the JSAPI. See this article:
http://birtworld.blo...jboss-seam.html

Jason
0

#7 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 03 April 2012 - 08:30 AM

Palidin74,

Does your code work if you do not pass in the xml stream?

Jason
0

#8 User is offline   paladin74 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-April 12


Posted 05 April 2012 - 10:48 AM

View PostJasonW, on 03 April 2012 - 08:30 AM, said:

Palidin74,

Does your code work if you do not pass in the xml stream?

Jason


Jason,

following lines have been removed from the servlet:

appContext.put("org.eclipse.datatools.enablement.oda.xml.inputStream", inputStream);

appContext.put("org.eclipse.datatools.enablement.oda.xml.closeInputStream", "true");



Unfortunately, with the same result as described above. The custom_<some_long_number>.svg is created in images directory, and opening the file directly with the firefox browser of cause showing the data which was originally used when created the report file.

Regards,

Pala
0

#9 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 05 April 2012 - 12:54 PM

I assume if you use png output format for charts the file does not come through?

Jason
0

#10 User is offline   paladin74 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-April 12


Posted 06 April 2012 - 07:04 AM

View PostJasonW, on 05 April 2012 - 12:54 PM, said:

I assume if you use png output format for charts the file does not come through?

Jason


Jason,

changing the output format from svg to png on the report design did not make any change. The file is created but does not come through.

Pala.
0

#11 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 10 April 2012 - 06:28 AM

Pala,

I did not see in your code where you are setting the output. Are you sending it to a file or an output stream?

options.setOutputStream(resp.getOutputStream());

Jason
0

#12 User is offline   paladin74 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-April 12


Posted 12 April 2012 - 12:57 PM

View PostJasonW, on 10 April 2012 - 06:28 AM, said:

Pala,

I did not see in your code where you are setting the output. Are you sending it to a file or an output stream?

options.setOutputStream(resp.getOutputStream());

Jason



Jason,

thanks it works fine, now.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users