facebook

Passing Parameters From JSF to an embedded birt report .

  1. MyEclipse Archived
  2.  > 
  3. MyEclipse Reports
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #296934 Reply

    shen747
    Member

    Hi,
    I want to pass a user entered parameter to an embedded birt report. But when I do so using JSF(jaav EE 5,tomcat 6.0.18,jsf 1.2) I get the following error :

    org.eclipse.birt.report.engine.api.EngineException: Can not convert the value of #{ReportBean.requestId} to Integer type.

    This is My JSP Code :

    <%@page contentType=”text/html”%>
    <%@page pageEncoding=”UTF-8″%>

    <%@taglib prefix=”f” uri=”http://java.sun.com/jsf/core”%&gt;
    <%@taglib prefix=”h” uri=”http://java.sun.com/jsf/html”%&gt;
    <%@ taglib uri=”/WEB-INF/tlds/birt.tld” prefix=”birt”%>

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
    http://www.w3.org/TR/html4/loose.dtd”&gt;
    <f:view>
    <html>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
    <title>Embedded Birt Report/JSF Demo</title>
    </head>
    <body>
    <h2>
    <h:outputText
    value=”Embedded Birt Reporting With JavaServer Faces Demo” />
    </h2>
    <h:form>
    <h:outputText value=”Enter Request Id :” style=”font-weight: bold” />
    <h:inputText id=”requestId” value=”#{ReportBean.requestId}”
    required=”true” />
    <h:commandButton value=”Generate Report” />
    </h:form>

    <br/>
    <%– The Embedded Birt Report Viewer –%>
    <birt:viewer id=”birtViewer” reportDesign=”requestLog.rptdesign”
    pattern=”frameset” height=”450″ width=”700″ format=”html”
    isHostPage=”false”>
    <birt:param name=”requestId” value=”#{ReportBean.requestId}” />
    </birt:viewer>

    </body>
    </html>
    </f:view>

    My Faces-Config File

    <?xml version=’1.0′ encoding=’UTF-8′?>

    <faces-config version=”1.2″
    xmlns=”http://java.sun.com/xml/ns/javaee&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd”&gt;

    <managed-bean>
    <managed-bean-name>ReportBean</managed-bean-name>
    <managed-bean-class>com.moota.birt.report.beans.ReportBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

    </faces-config>

    My Report Bean

    public class ReportBean {

    private int requestId;

    public int getRequestId() {
    return requestId;
    }

    public void setRequestId(int requestId) {
    this.requestId = requestId;
    }
    }

    **.Please Help me ,what am I doing wrong ??!.

    #296940 Reply

    shen747
    Member

    Hey Thanks anyway I figured it out…Just had to pass the parameter to the embedded birt viewer in the following manner..

    <%– The Embedded Birt Report Viewer –%>
    <birt:viewer id=”birtViewer” reportDesign=”requestLog.rptdesign”
    pattern=”frameset” height=”450″ width=”700″ format=”html”
    isHostPage=”false”>

    <birt:param name=”requestId” value=”${ReportBean.requestId}” />

    </birt:viewer>

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Passing Parameters From JSF to an embedded birt report .

You must be logged in to post in the forum log in