| How to pass the value of one data set into the another dataset? [message #997418] |
Mon, 07 January 2013 07:13  |
Soumita Das Messages: 19 Registered: January 2013 |
Junior Member |
|
|
Hi,
I am new to BIRT.I have created a report having the fields Name(a combo box),StartTime(textfield) and End time (Textfield).
on entering the repective values in this fields I should be able to see a report containing the details against that particular name.
How do I pass the outputs or values of the parameters used in the first dataset in to the second dataset to get the required details?
Any help would be greatly appreciated.
Thanks in advance!!!!
|
|
|
| Re: How to pass the value of one data set into the another dataset? [message #997510 is a reply to message #997418] |
Mon, 07 January 2013 16:53   |
|
If you're setting up a report parameter for the combo box for the name, you can use the value of this report parameter to limit any dataSet. In SQL, you could use a dataSet parameter marker '?' in your query to mark where you want to use the parameter, in your where statement and link the dataSet parameter to your report parameter in the dataSet editor. Otherwise, you can use the parameter in a filter to limit your dataSet. Let me know if I'm misunderstanding something.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
|
|
|
|
|
|
| Re: How to pass the value of one data set into the another dataset? [message #1000958 is a reply to message #997418] |
Tue, 15 January 2013 14:25   |
|
This can probably be cleaned up some, but take a look at this example. It fills a select list box using the values from a parameter ds. I use a computed column in that dataSet to concatenate the values for use in the html list box. The current parameter value is always the default, in the list box. All is the report parameter default, so All starts out selected. If the value changes, the report is ran again by calling a javascript function you can see in the text box at the top of the report. Hope this helps. Let me know if you have questions. Again, this is a quick, messy example, so you could probably clean it up some.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
[Updated on: Tue, 15 January 2013 14:26] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: How to pass the value of one data set into the another dataset? [message #1004915 is a reply to message #1004418] |
Thu, 24 January 2013 00:48   |
|
I tested this a little bit. I just replaced the this.queryText in the beforeOpen. When doing this, I got errors until I removed the parameter markers '?' from the query in the dataset editor. After removing those, a script like the following allowed me to pass my parameters as expected, where cnum, startDate, and endDate are my correctly formatted parameter strings:
this.queryText = "{call getPaymentsByCustomerAndDate('" + cnum + "','" + startDate + "','" + endDate + "')}";
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
| Re: How to pass the value of one data set into the another dataset? [message #1005209 is a reply to message #1005047] |
Thu, 24 January 2013 11:37   |
|
In the example I provided earlier, the only reason I passed the parameters in the beforeOpen was because I used an SQL query with no where statement for the original run of the report and then only limited the returns based on what was selected in the html form in the report. If you limit the initial query results to certain values, which you'd likely have to do with a stored procedure, there should be no real reason for you to use the beforeOpen script. You should just be able to link your report parameters to your dataSet parameters in the dataSet editor.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07329 seconds