MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
shen747
Post subject: Passing Parameters From JSF to an embedded birt report .  PostPosted: Mar 30, 2009 - 07:53 AM



Joined: Mar 30, 2009
Posts: 2

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 ??!.
 
 View user's profile Send private message  
Reply with quote Back to top
shen747
Post subject: RE: Passing Parameters From JSF to an embedded birt report .  PostPosted: Mar 30, 2009 - 09:11 AM



Joined: Mar 30, 2009
Posts: 2

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">
Quote:
<birt:param name="requestId" value="${ReportBean.requestId}" />

</birt:viewer>
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits