【问题标题】:reports and chart generation using birt,jsf and jsf4birt使用 birt、jsf 和 jsf4birt 生成报告和图表
【发布时间】:2012-04-18 14:49:43
【问题描述】:

谁能指导我在 websphere/tomcat 平台上使用 jsf4birt 在 jsf 中使用 BIRT 生成的图表的步骤?

我已经完成了http://exadel.org/jsf4birt-docs 网站中提到的所有事情。

但我仍然收到以下异常:

SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /workpages/pageb.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1f528ab]
Apr 18, 2012 8:04:16 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
    at org.eclipse.birt.report.engine.api.impl.ReportEngine$EngineExtensionManager.<init>(ReportEngine.java:819)
    at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:111)
    at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18)
    at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14)
    at com.exadel.jsfbirt.engine.BirtEngine.getBirtEngine(BirtEngine.java:80)
    at com.exadel.jsfbirt.engine.BirtRendererUtils.renderBirt(BirtRendererUtils.java:134)
    at com.exadel.jsfbirt.renderkit.html.BirtWrapperRenderer.doEncodeBegin(BirtWrapperRenderer.java:162)
    at com.exadel.jsfbirt.renderkit.html.BirtWrapperRenderer.encodeBegin(BirtWrapperRenderer.java:127)
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)

此外,还想知道以下上下文参数的含义,这些上下文参数根据网站链接添加到 web.xml:

<context-param>
  <param-name>actuate.serverUrl</param-name>
  <param-value>http://localhost:8900/iportal</param-value>
</context-param>

<context-param>
  <param-name>actuate.serverLogin</param-name>
  <param-value>administrator</param-value>
</context-param>

<context-param>
  <param-name>actuate.serverPassword</param-name>
  <param-value></param-value>
</context-param>

【问题讨论】:

    标签: jsf charts report birt


    【解决方案1】:
    Finally the code worked for me. Steps to be followed are as follows :
    
    1. Make a dynamic web project (jsf project if you want to use jsf tags).
    2. Once your project is ready prepare your report. Prepare your data sets for report/chart generation, a sample query is mentioned below.
    
    select count(customernumber) cuscount,State
    from customers
    where country=? -- this is the parameter you can give as input
    group by state
    
    
    3. Once you are done with this part add following parameters to web.xml
    
    <context-param>
    <param-name>actuate.serverUrl</param-name>
    <param-value>http: localhost:8900 iportal</param-value>(please add //,/ respectively in the blank spaces.)
    </context-param>
    <context-param>
    <param-name>actuate.serverLogin</param-name>
    <param-value>administrator</param-value>
    </context-param>
    <context-param>
    <param-name>actuate.serverPassword</param-name>
    <param-value></param-value>
    </context-param>
    <context-param>
    <param-name>org.eclipse.birt.configPath</param-name>
    <param-value>**/configuration/config.ini**</param-value> 
    </context-param>
    
    **Place the configuration folder inside WEB-CONTENT.**
    
    If this is not done properly you can get null pointer exception.
    
    4. Copy the "platform" folder inside WEB-INF.
    
    5. The list of required jars are mentioned in the screen attached with this post.
    (Downloading the dummy module of jsf4birt from exadel website will be helpful).
    
    6. A tricky part that I found after struggling for few days. If you get **version mismatch error or unsupported exception**, open your reportfile.rptdesign in text editor u will get something like 
    <report xmlns="http //www.eclipse.org/birt/2005/design" **version="3.2.20"** id="1">
    
    Change this version to the one that is supported by your server/IDE. I changed it from 3.2.23 to 3.2.20.
    
    7. Finally the birt:birtWrapper worked for me. Where country is my parameter.
    
    <birt:birtWrapper id="t" reportDesign="customerdetails.rptdesign" rendered="true">
    <f:param name="country" value="#{form.country}"></f:param></birt:birtWrapper>
    
    And then finally it worked for me. 
    
    I am trying to explore more features of BIRT like adding comments to a point on chart and generating reports in pdf format. Please do let me know if you are aware of these stuffs. 
    

    【讨论】:

      猜你喜欢
      • 2014-09-26
      • 2012-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-12
      • 1970-01-01
      相关资源
      最近更新 更多