Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Multiple Submit Buttons in Custom Parameter Page
Multiple Submit Buttons in Custom Parameter Page [message #702752] Tue, 26 July 2011 19:07 Go to next message
Scroon  is currently offline Scroon Friend
Messages: 28
Registered: June 2011
Junior Member
Hello,

I'm trying to build a custom parameter page which can invoke different reports with same parameter set.

E.g.: In the following picture
index.php/fa/3485/0/

User can run report A or report B as they wish, passing same parameters.


With a custom parameter page:

//example.jsp

.....
<birt:parameterPage id="birtParmPage" reportDesign="Report_A.rptdesign"
name="my form"
pattern="frameset"
format="html"
isCustom="true"
showTitle="true"
showToolBar="true"
showNavigationBar="true"
>
ClientName: <birt:paramDef id="11" name="ClientName" "/>
<br>
Date From:
<input type="text" name="date_from" />
To:
<input type="text" name="date_to" />
<br>
<input type="submit" name="submit" value="Run Report A"/>
......
.......
</birt:parameterPage>
....

....

<script type="text/javascript">
function RunReportB(){
window.location = "http://localhost/frameset?__report=Report_B.rptdesign&ClientName=<how to get the value of parameter ClientName, which is set by user?>&date_from=<how to get the value of parameter date_from?>&date_to=<how to get the value of parameter date_to?>"
}
</script>

<input type="button" value="Run Report B" onclick="RunReportB();"/>
The problem will be solved if we can get the values of parameter ClientName,date_from,date_to out from <birt:parameterPage> .... </birt:parameterPage> in any place in the jsp file.

  • Attachment: 1.JPG
    (Size: 9.72KB, Downloaded 1424 times)

[Updated on: Tue, 26 July 2011 19:25]

Report message to a moderator

Re: Multiple Submit Buttons in Custom Parameter Page [message #702867 is a reply to message #702752] Tue, 26 July 2011 22:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Do something like the following:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/tlds/birt.tld" prefix="birt" %>
<%int myparm=22;%>
<!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">
<title>Insert title here</title>
<style type="text/css">
..class1 { color:#ff0000; }
</style>

<script language="JavaScript">
function testme(){

alert("here" + document.page1.action );
var act = document.page1.action;
var newact =act.replace("testtag.rptdesign", "testtag2.rptdesign");
document.page1.action = newact;
return false;
}

</script>

</head>
<body>

Parameter Page 1
<br>
<birt:parameterPage
id="report1"
name="page1"
reportDesign="testtag.rptdesign"
isCustom="true"
baseURL="/2.6.2"
pattern="preview">
Text Parameter: <birt:paramDef id="1" name="text" cssClass="class1"
value="<%=myparm%>"/>
<br><br>
<input type="submit" value="Sumbit form A" onclick="JavaScript:testme()"/>
<input type="submit" name="submit" value="Sumbit form B"/>

<br><br>
</birt:parameterPage>



<br>
</body>
</html>


On 7/26/2011 3:07 PM, Scroon wrote:
> Hello,
>
> I'm trying to build a custom parameter page which can invoke different reports with same parameter set.
>
> E.g.: In the following picture
>
>
> User can run report A or report B as they wish, passing same parameters.
>
>
> With a custom parameter page:
>
> .....
> <birt:parameterPage id="birtParmPage" reportDesign="report.rptdesign"
> name="my form"
> pattern="frameset"
> format="html"
> isCustom="true"
> showTitle="true"
> showToolBar="true"
> showNavigationBar="true"
>>
> ClientName:<birt:paramDef id="11" name="ClientName" "/>
> <br>
> Date From:
> <input type="text" name="date_from" />
> To:
> <input type="text" name="date_to" />
> <br>
> <input type="submit" name="submit" value="Run Report A"/>
> ......
> .......
> </birt:parameterPage>
>
>
> If we can get the values of parameter ClientName,date_from,date_to in any place out of<birt:parameterPage> ....</birt:parameterPage>, then the problem is solved....
>
>
Re: Multiple Submit Buttons in Custom Parameter Page [message #703418 is a reply to message #702867] Wed, 27 July 2011 14:52 Go to previous messageGo to next message
Scroon  is currently offline Scroon Friend
Messages: 28
Registered: June 2011
Junior Member
Thanks Jason, it works good
Re: Multiple Submit Buttons in Custom Parameter Page [message #703426 is a reply to message #703418] Wed, 27 July 2011 15:01 Go to previous messageGo to next message
Scroon  is currently offline Scroon Friend
Messages: 28
Registered: June 2011
Junior Member
Just one further question, is there other property we can modify on the fly, besides document.page1.action, like document.page1.<Parameters>; ? Razz

Thanks.

[Updated on: Wed, 27 July 2011 15:02]

Report message to a moderator

Re: Multiple Submit Buttons in Custom Parameter Page [message #703465 is a reply to message #703426] Wed, 27 July 2011 15:25 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Run the parameter page to html and view the source. You will see the
form the tags create and the parameters. The only issue is that they
will have javascript functions already generated for most of the
parameters. You can just manipulate the dom the same way the previous
example showed.

Jason



On 7/27/2011 11:01 AM, Scroon wrote:
> One further question, is there other property we can modify, besides
> document.page1.action, like
> document.page1.<ParametersPassingToTheReport>; ?
Previous Topic:INPUT PARAMETERS
Next Topic:what is doing between a dataset afterOpen event and onFetch event?
Goto Forum:
  


Current Time: Fri Apr 19 07:32:04 GMT 2024

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

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

Back to the top