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)
Passing values to sub reports
megabri
<p>I have a birt report that has two data sets. The first is a parent data set and the second is a child data set. The parent has information on work order like so:</p><p> </p><p>Wonum Work Description</p><p>1000 Light bulb replaced</p><p>1001 Wires changed out</p><p>1002 I beam moved to a new location</p><p> </p><p>The child has people who were assigned to each work order so it would be like this:</p><p>Wonum Person</p><p>1000 John Smith</p><p>1001 Mike Jones</p><p>1001 Joe Shmoe</p><p>1001 Bob Sanchez</p><p>1002 Sam Ryan</p><p> </p><p>I set the report up so the parent data set is tied to a table element and the child data set is tied to a table that is inside the parent table. I try to pass the parent's wonum information to the child table by doing rows[0]["wonum"] but it only shows the first value. So information for wonum 1000 comes up but 1001 and 1002 don't show. Any advice?</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p><p> </p><p>In the Assignments table, you need to add a filter in the properties for that table. The filter will act as a join between the AssignmentDataSet and the MainDataSet, based on the common fields between the two tables.</p><p> </p><p>I have attached an example using Customers and Orders in Classic Models. Look at the Filter for the table that contains the Ordernumber: you will see a join between CustomerNumber in the Orders table and CustomerNumber in the Customers table (a.k.a. the outer table)</p><p> </p><p>Hope this helps,</p><p> </p><p>P.</p>
megabri
<p>Hey P.,</p><p> </p><p>I can't open your file because I'm using a new version of BIRT but I think I get the general concept. I added row._outer["wonum"] to the filter and took out the row[0] in my AssignmentDataSet query but I'm still getting the same problem. Only the first record shows. I did a test before and took out the assignment table from the form so it was just the MainDataSet's table and all my records came back. As soon as I add the AssignmentDataSet's table back to the form it only shows the first record.</p>
megabri
<p>P.</p><p> </p><p>I made a simple report to replicate the error, lets work with this one. This one the main data set has a list of assets (I have over 500 so there should be a few entries). The wonum data set shows all the work orders that are associated with these assets. The common field is assetnum.</p><p> </p><p>- Mike</p>
pricher
<p>Which version of BIRT are you using? I can't open your last file..
</p>
megabri
<p>So i found something weird... I have two different version of BIRT (3.7.1 and 2.3.2). The file you were able to view before was made in 2.3.2 the file you couldn't open was made in 3.7.1. I was recreating the file for you in 2.3.2 so we could go over it and then.... it worked properly in 2.3.2. It's the same report... I don't understand why it's working in one environment and not the other... Here's the 2.3.2 version...</p>
micajblock
<p>There are OOTB Maximo reports that use sub-reports. You can use those as examples. asset_hierarchy.rptdesign is one, Additionally why not just have one data set and join the asset and workorder table? Nested reports are performance killers and there is a query for each sub-report.</p>
wwilliams
<p>This may be your issue</p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/29723-subreport-query-fails-to-run-after-first-non-null-row-returned-for-maximo-75/'>http://developer.actuate.com/community/forum/index.php?/topic/29723-subreport-query-fails-to-run-after-first-non-null-row-returned-for-maximo-75/</a></p>
;
megabri
<p>Thanks wwilliams. That solved my problem. Good to know I'm not crazy and that it was just a bug with a work around.</p>