Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Multiple dependent datasets
lphipps
<p>I have a report that has several datasets. the first 3 are used to define and pull a set of primary keys from a table. I set this up using the a couple of report parameters and then a cascading parameter group. This all works fine and the dataset populates with the keys. Here is my problem. I need to use this dataset as the source parameters to pull back data for 2 other datasets. The sql is somthing like this.</p><pre class="_prettyXprint _lang-sql">select * from myTable where id in (project_id)</pre><p>I'm replacing project_id in the beforeOpen event on the dataset</p><pre class="_prettyXprint _lang-sql">var rawIdString = params["ids"].value.join(",");var p_ids = rawIdString.split(",");var idString = "";for (var i=0;i<p_ids.length;i++){ if (i < p_ids.length - 1) { idString += "'"+p_ids[i]+"',"; } else { idString += "'"+p_ids[i]+"'"; }}this.queryText=this.queryText.replaceAll('project_id',idString);</pre><p>I have gotten it work when previewing the report but not in the stand alone report viewer. Is there another way to accomplish what I'm trying to do?</p>
Find more posts tagged with
Comments
johnw
<p>That is the hard way to do it. </p><p> </p><p>The easier way is to use Data Set Binding in the tables. </p><p> </p><p>If you need to see an example of this, from your Eclipse BIRT designer, go to Window/Show Viewer/ Other/Report and Chart Design/Report Examples. The report example you are looking for is under Sub-Report.</p><p> </p><p>In it, there are two Data Sets, OrderList and OrderDetails. OrderDetails is dependent on OrderList. OrderDetails has a single parameter that is set in the WHERE clause. If you look at the Report Design, there is a main table, bound to OrderList. The inside table is bound to OrderDetails, where the data set parameter is being set from a value in OrderList. You can see this by going to Property Editor/Binding and clicking on the Data Set Parameter Binding. The value of ORDERNUMBER is being passed in.</p>
lphipps
<p>Thanks I'll take a look at that.</p>