Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Parameters
Parameters [message #788853] Thu, 02 February 2012 09:45 Go to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
I want to use dynamic combo-box parameter.

index.php/fa/6984/0/

But data set for this combo-box use parameter too. It's Date.

index.php/fa/6983/0/

How can I do it?
  • Attachment: 2.gif
    (Size: 38.37KB, Downloaded 3360 times)
  • Attachment: 1.gif
    (Size: 9.04KB, Downloaded 2893 times)
Re: Parameters [message #789239 is a reply to message #788853] Thu, 02 February 2012 19:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You need to use a cascaded parameter to one parameter affect another.
Look at the attached example.

Jason

On 2/2/2012 4:45 AM, Bryan Jasso wrote:
> I want to use dynamic combo-box parameter.
>
>
>
> But data set for this combo-box use parameter too. It's Date.
>
>
>
> How can I do it?
Re: Parameters [message #789524 is a reply to message #789239] Fri, 03 February 2012 04:23 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
I found example about cascading parameter group. It use Data set with a limited set of dates for Dates parameter.

But I use calendar, where I can select any date.
index.php/fa/7009/0/

And then can I use this parameter (picked from calendar) in the cascade parameter?

  • Attachment: 3.gif
    (Size: 11.89KB, Downloaded 2920 times)
Re: Parameters [message #789537 is a reply to message #789524] Fri, 03 February 2012 04:52 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
"Name" dynamic combo-box parameter based on data set, which use parameter too ("Date").

1. Select date from calendar.

2. Data set for "Name" dynamic combo-box parameter:
SELECT *
FROM BD.EMTMOFFER MOFFER
WHERE MOFFER.OFFEREND = ?
(where ? - Date from 1st parameter)
So I need to get values for combo-box.
Re: Parameters [message #789968 is a reply to message #789537] Fri, 03 February 2012 16:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Open source BIRT does not currently have a calendar widget on the
parameter entry screen, Others have customized the viewer to plugin in
one though. Have a look at:
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/770-calendar-for-date-parameter-in-birt-viewer/

Jason

On 2/2/2012 11:52 PM, Bryan Jasso wrote:
> "Name" dynamic combo-box parameter based on data set, which use
> parameter too ("Date").
>
> 1. Select date from calendar.
>
> 2. Data set for "Name" dynamic combo-box parameter:
> SELECT *
> FROM BD.EMTMOFFER MOFFER
> WHERE MOFFER.OFFEREND = ? (where ? - Date from 1st parameter)
> So I need to get values for combo-box.
Re: Parameters [message #791613 is a reply to message #789968] Mon, 06 February 2012 03:20 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
As you can see on screenshot, I've already use calendar widget. It's not a question.
Problem is How to use date from this parameter (from calendar widget) in other parameters.
Re: Parameters [message #792344 is a reply to message #791613] Mon, 06 February 2012 22:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is that date parameter the first parameter in a cascade? It has to be
to affect the next set of parameters.

Jason

On 2/5/2012 10:20 PM, Bryan Jasso wrote:
> As you can see on screenshot, I've already use calendar widget. It's not
> a question.
> Problem is How to use date from this parameter (from calendar widget) in
> other parameters.
Re: Parameters [message #792522 is a reply to message #792344] Tue, 07 February 2012 04:36 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
Jason Weathersby wrote on Mon, 06 February 2012 17:39
Is that date parameter the first parameter in a cascade? It has to be
to affect the next set of parameters.


I can't add Date parameter to cascade, because in cascade I can use only data from dataSet. Isn't it?
Re: Parameters [message #793140 is a reply to message #792522] Tue, 07 February 2012 20:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Bryan,

The best way to do this is to probably design your own parameter page
using JSP Tag Library. I am attaching an example JSP page that you can
add to the viewer and run it. I am also attaching a report. The JSP
simply hides the first level in the cascade and then adds another box to
enter a country name. When the country is entered the the second level
of the cascade is re-fired.
The JSP has the following code:

<%@ 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">
<title>Insert title here</title>

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

var first = document.getElementById("5");
var newval = document.getElementById("4");
first.value = newval.value;
//alert("here" + first.value);
first.onchange();
//alert( first.selectedIndex );
return false;
}

</script>

</head>
<style type="text/css">
..class1 { background-color:#ffffff; color: #000000; display: none }
</style>
<body>

Parameter Page 1
<br>
Enter Country:
<input type="text" id="4" value="USA"
onchange="JavaScript:changeCountry()"/>
<birt:parameterPage
id="report1"
name="page1"
reportDesign="cascade_report.rptdesign"
isCustom="true"
pattern="frameset">

Cascading Parameter1 This parameter is hidden: <birt:paramDef id="5"
name="Country" value="USA" cssClass="class1"/>
<br><br>
Cascading Parameter2: <birt:paramDef id="6" name="City"/>
<br><br>
Cascading Parameter3: <birt:paramDef id="7" name="Customer"/>
<br><br>
<input type="submit" name="submit" value="Sumbit form"/>
<br><br>
</birt:parameterPage>
<br>
</body>
</html>

Jason

On 2/6/2012 11:36 PM, Bryan Jasso wrote:
> Jason Weathersby wrote on Mon, 06 February 2012 17:39
>> Is that date parameter the first parameter in a cascade? It has to be
>> to affect the next set of parameters.
>
>
> I can't add Date parameter to cascade, because in cascade I can use only
> data from dataSet. Isn't it?
Re: Parameters [message #794329 is a reply to message #793140] Thu, 09 February 2012 06:35 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
Thanks. I made JSP Parameter page:
index.php/fa/7093/0/
And I can select Date here. Then press "Submit" and get Parameter page, where I can select Company for that day.
index.php/fa/7094/0/

But can I refresh and select parameter Company on JSP page too? and skip then Parameter page.
  • Attachment: 2.gif
    (Size: 9.93KB, Downloaded 2890 times)
  • Attachment: 1.gif
    (Size: 8.34KB, Downloaded 2821 times)
Re: Parameters [message #794793 is a reply to message #794329] Thu, 09 February 2012 17:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If your parameter page has:

isCustom="true"

The default parameter page should not be launching unless a required
parameter is not set.

Jason

On 2/9/2012 1:35 AM, Bryan Jasso wrote:
> Thanks. I made JSP Parameter page:
>
> And I can select Date here. Then press "Submit" and get Parameter page, where I can select Company for that day.
>
>
> But can I refresh and select parameter Company on JSP page too? and skip then Parameter page.
>
Re: Parameters [message #795078 is a reply to message #794793] Fri, 10 February 2012 03:10 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ 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=UTF-8">
<title>Insert title here</title>

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

var first = document.getElementById("8");
var newval = document.getElementById("25");
first.value = newval.value;
//alert("here" + first.value);
first.onchange();
//alert( first.selectedIndex );
return false;
}

</script>

	
	<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
	<SCRIPT LANGUAGE="JavaScript">var cal = new CalendarPopup();</SCRIPT>

</head>
<style type="text/css">
.class1 { background-color:#ffffff; color: #000000; display: none };
</style>


<body>

<FORM NAME="example">
<INPUT TYPE="text" id="25" NAME="Date" VALUE="" SIZE=25 onClick="cal.select(document.forms['example'].Date,'25','yyyy-MM-dd'); return false;" onmouseout="JavaScript:changeCountry()"/>
</FORM>
<button onClick="JavaScript:changeCountry()">Выбрать</button>

</birt:param> 
<birt:parameterPage
		id="report1" 
		name="page1"
		reportDesign="cascade_report.rptdesign"
		isCustom="true"
		pattern="frameset">
		
		Parameter Date: (This parameter is hidden) <birt:paramDef id="8" name="Date" cssClass="class1"/>
		<br><br>	
		Parameter Company: <birt:paramDef id="9" name="BGName"/>
		<br><br>
		<input type="submit" name="submit" value="OK"/>
		<br><br>
</birt:parameterPage>
<br>
</body>
</html>

But parameter named "BGName" don't reload when I change parameter "Date".

index.php/fa/7106/0/
  • Attachment: 5.gif
    (Size: 7.15KB, Downloaded 2722 times)
Re: Parameters [message #795536 is a reply to message #795078] Fri, 10 February 2012 15:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You have to have BGName and Data parameters in a cascade. btw I do not
see the parameter "Date"(Might want a better name for the parameter) in
your design. It should be the first level in the cascade, and you might
just want to link it to a dummy data set, because you are technically
not going to use its value. You will be setting it with the calendar.

Jason


On 2/9/2012 10:10 PM, Bryan Jasso wrote:
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> <%@ 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=UTF-8">
> <title>Insert title here</title>
>
> <script language="JavaScript">
> function changeCountry(){
>
> var first = document.getElementById("8");
> var newval = document.getElementById("25");
> first.value = newval.value;
> //alert("here" + first.value);
> first.onchange();
> //alert( first.selectedIndex );
> return false;
> }
>
> </script>
>
>
> <SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
> <SCRIPT LANGUAGE="JavaScript">var cal = new CalendarPopup();</SCRIPT>
>
> </head>
> <style type="text/css">
> class1 { background-color:#ffffff; color: #000000; display: none };
> </style>
>
>
> <body>
>
> <FORM NAME="example">
> <INPUT TYPE="text" id="25" NAME="Date" VALUE="" SIZE=25 onClick="cal.select(document.forms['example'].Date,'25','yyyy-MM-dd'); return false;" onmouseout="JavaScript:changeCountry()"/>
> </FORM>
> <button onClick="JavaScript:changeCountry()">Выбрать</button>
>
> </birt:param>
> <birt:parameterPage
> id="report1"
> name="page1"
> reportDesign="cascade_report.rptdesign"
> isCustom="true"
> pattern="frameset">
>
> Parameter Date: (This parameter is hidden)<birt:paramDef id="8" name="Date" cssClass="class1"/>
> <br><br>
> Parameter Company:<birt:paramDef id="9" name="BGName"/>
> <br><br>
> <input type="submit" name="submit" value="OK"/>
> <br><br>
> </birt:parameterPage>
> <br>
> </body>
> </html>
> But parameter named "BGName" don't reload when I change parameter "Date".
>
>
Re: Parameters [message #795628 is a reply to message #795536] Fri, 10 February 2012 17:57 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
Data and Date - the same parameter (old screenshot, I renamed it).
Don't understand what is "dummy data set".
Re: Parameters [message #797179 is a reply to message #795628] Mon, 13 February 2012 06:35 Go to previous messageGo to next message
Bryan Jasso is currently offline Bryan JassoFriend
Messages: 14
Registered: January 2012
Junior Member
Thanks. Solved. Сreated a fake dataset: "SELECT ? AS DATE_1 FROM DUAL" and used it in cascade parameter.
Re: Parameters [message #1802587 is a reply to message #797179] Tue, 12 February 2019 10:34 Go to previous message
Parth Desai is currently offline Parth DesaiFriend
Messages: 3
Registered: January 2019
Junior Member
Can you please share the rptdesign file I am also trying to create a report where user will input or select any date and based on that will list my parameter value
Previous Topic:BIRT : Filter cascaded Report Parameter group based on Local Report Parameter
Next Topic:Insert new line in Table Head Label
Goto Forum:
  


Current Time: Thu Apr 18 02:52:01 GMT 2024

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

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

Back to the top