Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to pass the value of one data set into the another dataset?
How to pass the value of one data set into the another dataset? [message #997418] Mon, 07 January 2013 12:13 Go to next message
Soumita Das is currently offline 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 21:53 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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.



Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #997976 is a reply to message #997510] Wed, 09 January 2013 05:23 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Thanks for the help but I need to do something like I will have three fields name,startdate and enddate.
On selection of these three parameters/values I will generate a report of the particular details of my selected values of name(from combo box)and the respective dates.
Am attaching a screen shot of how it might look after I have done the selection from the combo box and textfeilds.
In addition to this when am using a report parameter I get "pop-ups" for the combo-box and dates which I don't want.
I simply want togive the values in the report page itself and not through any pop-ups.
Re: How to pass the value of one data set into the another dataset? [message #998493 is a reply to message #997976] Thu, 10 January 2013 05:22 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

You could either create a form, in an HTML text box, in your report, then call your report by URL when the button is pressed. Or, you could look into using the tag library to embed your parameters and report into a JSP page to keep the parameter selection and report on a single page.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #998605 is a reply to message #998493] Thu, 10 January 2013 10:38 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Hi,
Thanks for the help.If I follow the first method the report will be opened in another page right?
Could you please elaborate a bit about the second method you have suggested.
It will be of great help.
Re: How to pass the value of one data set into the another dataset? [message #998634 is a reply to message #998605] Thu, 10 January 2013 11:49 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Hi,
Is there any way we can avoid/hide the pop up that appears in adding "Report parameter"?
Re: How to pass the value of one data set into the another dataset? [message #998936 is a reply to message #998634] Fri, 11 January 2013 02:11 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

The first option can be loaded in the same window. Here's more about the tag library, for the second one:

http://www.eclipse.org/birt/phoenix/deploy/viewerUsage2.2.php#tags

To avoid the pop up, for the parameters, you can make the parameters hidden. There is also a URL parameter that can be used to decide to show or not show the parameter page.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #999008 is a reply to message #998936] Fri, 11 January 2013 06:28 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
I had used the hidden option but that makes the selection criteria non-functional then.By implementing "hidden" how can we select the parameters?
Basically I have made these dropdown and textboxes using html text.Now how do I pass these parameters (which I have selected i.e a particular set of name,start date and end date) and generate the deatiled report of that "particular" equipment(as I have selected from the html dropdown and text boxes.
I need to know how shall I pass these 3 parameters to call the actual report.
Using report parameters solves the problem but it brings the pop-ups and I need to do the selection through html dropdown and textboxes.
Hope I could clear where I am stuck.
Re: How to pass the value of one data set into the another dataset? [message #999346 is a reply to message #999008] Fri, 11 January 2013 21:58 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

What's your BIRT version, I'll make a simple example of the first option, including hiding the default parameter page, using the parameterpage=false url parameter.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.

[Updated on: Fri, 11 January 2013 21:59]

Report message to a moderator

Re: How to pass the value of one data set into the another dataset? [message #1000141 is a reply to message #999346] Mon, 14 January 2013 05:15 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
My BIRT version is 3.7.2
If you kindly make one example of the first example and shareit, it will be of great great help.
Am really clueless.
Thanks a lot!!!
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 19:25 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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. Smile

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.

[Updated on: Tue, 15 January 2013 19:26]

Report message to a moderator

Re: How to pass the value of one data set into the another dataset? [message #1001182 is a reply to message #1000958] Wed, 16 January 2013 08:01 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Thanks a lot for the help.
It helped to clear some concept.
But in the script "beforeOpen" I need to call a "stored procedure" and pass three parameters.
This is creating a problem for me.
I have written in these two ways:

this.queryText = " {call dbo.SP_RPT_EquipementSummary (Filler1,11/12/2012,12/12/2012)} ";
In the above way I have hardcoded the values.
this.queryText = " {call dbo.SP_RPT_EquipementSummary ('"+ params["Equipname"]+"',"+params["StartDate"]+","+params["EndDate"]+")} ";
In the above way,have given startdate and enddate default values

But none of these are working and hence query execution is not taking place.

Need your help.
Thanks a lot in advance!!!
Re: How to pass the value of one data set into the another dataset? [message #1001758 is a reply to message #1001182] Thu, 17 January 2013 10:33 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Hi
Michael,

Looking forward for your help regarding how to call a "stored procedure" instead of a "select query" in the "beforeOpen" method.
I need to pass three Parameters.
Re: How to pass the value of one data set into the another dataset? [message #1004182 is a reply to message #1001758] Tue, 22 January 2013 18:47 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

Sorry for the delayed response. So, you're not even able to pass the stored procedure query statically? Are you getting any errors?

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #1004415 is a reply to message #1004182] Wed, 23 January 2013 07:32 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
No I can't pass the stored procedure query.
In layout I am writing the following script:
window.location = window.location + '&EquipName=Filler1&StartDate=12/15/12&EndDate=12/16/12';

and in "beforeOpen" method
this.setInputParameterValue("@eqName", params["EquipName"]);
this.setInputParameterValue("@StartTimeUTC", params["StartDate"]);
this.setInputParameterValue("@EndTimeUTC", params["EndDate"]);

The error I am getting :
The following items have errors:


ReportDesign (id = 1):
+ There are errors evaluating script "
this.setInputParameterValue("@eqName", params["EquipName"]);
this.setInputParameterValue("@StartTimeUTC", params["StartDate"]);
this.setInputParameterValue("@EndTimeUTC", params["EndDate"]);
null. (Element ID:1)
Re: How to pass the value of one data set into the another dataset? [message #1004418 is a reply to message #1004415] Wed, 23 January 2013 07:36 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
I am attaching my code.
Really looking forward for your help..
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 05:48 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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 + "')}";


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #1005039 is a reply to message #1004915] Thu, 24 January 2013 11:13 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
I tried implementing what you said but I still cant get the result.
Re: How to pass the value of one data set into the another dataset? [message #1005047 is a reply to message #1005039] Thu, 24 January 2013 11:28 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Could you please share the code?
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 16:37 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #1005738 is a reply to message #1005209] Mon, 28 January 2013 13:36 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Thanks a lot..your help solved my problem..it worked.
I have a few more questions.
1>When I run the report in "webviewer" or "html" format I get to see the result covering only half of the screen where as i need it to cover the full screen.
2>Secondly even after importing a css file the changes do not get reflected.
For e.g it considers "Text" as wherever "Text" has been used and not the particular portion I want .
Re: How to pass the value of one data set into the another dataset? [message #1005741 is a reply to message #1005738] Mon, 28 January 2013 13:44 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
I am attching the code..It show all the "text" red where as I want only the "Text" of the topmost html code red.
Re: How to pass the value of one data set into the another dataset? [message #1005815 is a reply to message #1005741] Mon, 28 January 2013 20:26 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

When you say you want it to cover the whole screen, do you mean you want to spread the report out to cover the screen? Or do you want to wrap the table in a newspaper like layout?

As for the text color, can you attach a css file and a .rptdesign file that I can run to see the issue you're having? Thanks.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #1005860 is a reply to message #1005815] Tue, 29 January 2013 06:11 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Hi,
I am attaching the screen shot of how the report is looking when I am viewing it in "webviewer" mode.
I have applied some black arrow marks to make you understand what is the exact problem of not covering the whole screen.
Re: How to pass the value of one data set into the another dataset? [message #1005864 is a reply to message #1005860] Tue, 29 January 2013 06:16 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Now I am attaching the rpt file and css files.
This rpt file after running show the problem of all "text" portion taking red color whereas I want only the portions related to "startdate","end date" and dropdown to use the attributes of the css file named "example.css"
More over css file "view.css" sets the attributes to the table having showing the report.Anyhow the other tables never get any attribute even giving specific names.
Re: How to pass the value of one data set into the another dataset? [message #1006032 is a reply to message #1005864] Tue, 29 January 2013 15:35 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

For the not filling the page issue, you might try the auto layout. You can change this by selecting an empty spot in the report, then scrolling to the bottom of the general tab in the property editor.

I'll take a look at the other issue and let you know if I have troubles seeing it.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: How to pass the value of one data set into the another dataset? [message #1006220 is a reply to message #1006032] Wed, 30 January 2013 13:45 Go to previous messageGo to next message
Soumita Das is currently offline Soumita Das
Messages: 19
Registered: January 2013
Junior Member
Hi Michael,
There is a new problem with the report.
When I am running it on the server for the first time it gives me correct result set passing all the three parameters.
But in the second run when I change the values of the parameters at runtime, only "equipment name" gets changed while start date and end date retains the old value.
Hence the results comes for the new equipment but with old values of start and end dates
I am attaching the file.
Need your help
Re: How to pass the value of one data set into the another dataset? [message #1006259 is a reply to message #1006220] Wed, 30 January 2013 15:39 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

With your multiple parameters, it might be easier to just build the URL, instead of trying to replace them. Just set the new location to the URL to the report, like localhost:8080/birt/frameset?__report=yourReport.rptdesign&param1=blah&param2=blah&param3=blah

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:multiples values from parameter
Next Topic:How to add a metadata to a field ?
Goto Forum:
  


Current Time: Wed Sep 17 01:37:39 GMT 2014

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

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