Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt:param tag, need help
Birt:param tag, need help [message #911885] Wed, 12 September 2012 14:04 Go to next message
Vani Ra is currently offline Vani RaFriend
Messages: 11
Registered: September 2012
Junior Member
Hello All,


I am working with IBM and using birt tool to generate a report on one of my assignments. I am facing problem with what am trying to accomplish. Here is a general overview of my requirement.

I am creating two jsp pages say index.jsp and display.jsp.

On index.jsp, am taking an input from the user say customer number and on display.jsp, am embedding a birt report having a variable CustNum.

I want the birt report on display.jsp page to take value that was entered by user in index.jsp and generate a report for that Customer only.

My understanding is I need to use the birt:param tag to set the value of the report parameter. But it just wont work.

Here is the code:

index.jsp

<% String CustNum = "";
request.setAttribute(CustNum, "CustNum"); %>
</head>
<body>
<form action="display.jsp" method="post">
CustomerNumber <input type="text" name="CustNum" />
<input type="submit" value ="Submit" />


display.jsp

<% String CustNum = request.getParameter("CustNum");
out.println(Integer.parseInt(CustNum));
%>

<birt:viewer id="birtViewer"
reportDesign="testBirt.rptdesign"
pattern="run"
height="450"
width="900"
format="html"
showParameterPage="False"
baseURL="/birt">
<birt:param name="CustId" value="<%=CustNum%>" ></birt:param>
</birt:viewer>

I tried using birt:param outside the viewer tag but i wont do anything. Inside the viewer tag, it gives an java lang error.

Any help would be much appreciated. I am kind of stuck on this since yesterday.

Thanks
Re: Birt:param tag, need help [message #912508 is a reply to message #911885] Thu, 13 September 2012 17:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I got this to work using the following (Note that I changed the baseURL to 3.7.2 because that is where my viewer is at(.


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>


</head>
<body>
<form action="display.jsp" method="post">
CustomerNumber <input type="text" name="CustNum" />
<input type="submit" value ="Submit" />
</body>
</html>



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>

<birt:viewer id="birtViewer"
reportDesign="testBirt.rptdesign"
pattern="run"
height="450"
width="900"
format="html"
showParameterPage="False"
baseURL="/3.7.2">
<birt:param name="CustId" value="<%= request.getParameter(\"CustNum\")%>"></birt:param>
</birt:viewer>
</body>
</html>

Jason
Re: Birt:param tag, need help [message #915646 is a reply to message #912508] Mon, 17 September 2012 17:23 Go to previous message
Vani Ra is currently offline Vani RaFriend
Messages: 11
Registered: September 2012
Junior Member
Hi Jason

thanks for your reply. It worked for me too. I was missing a jar file. I need help with one more thing. just posted it. Hope u can help.


thanks
Previous Topic:[chart] tooltip containing x label
Next Topic:Exception Handling of scripted data source for preview
Goto Forum:
  


Current Time: Fri Apr 26 21:15:25 GMT 2024

Powered by FUDForum. Page generated in 0.02820 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top