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"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ 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">
<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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<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 ??!.