Report binding to grandchildren objects

Report binding to grandchildren objects

Old forum URL: forums.lhotka.net/forums/t/1796.aspx


albruan posted on Monday, November 20, 2006

I've been working on creating reports for a project and haven't had any difficulties until now.  Basically, I have a hierarchy of BOs and I've been unable to iterate through the grandchildren when it comes time to generate a summary report.  At the top level, I have an Estimate object which contains a Departments collection of Department objects, each of which contains a Drawings collection of Drawing objects.  A simple tree of these objects is:

Estimate
|--- Departments
      |--- Department
             |--- Drawings
                    |--- Drawing

I can loop through all the Drawing objects of a selected Department 'til the cows come home by way of a Drawings myDwgs = Estimate.Departments[0].Drawing statement.  The Estimate object contains all the info I need for the header; all I need from each Department object is the name of its department (Architectural, Electrical, Foundation, Piping, Structural, etc.) for use in the body of the report.  The primary interest lies in the information contained in each of the Drawing objects.  I need to iterate through them to aggregate # of dwgs, manhours per dwg, etc. based on the drawing type (CADD, existing manually-drawn, demolition, etc.) and aggregate the results by Department.  In other words, iterate through each of the Department objects and for each one of them, iterate through their child Drawing objects.

What I end up with is an Estimate summary report showing all of the departments and aggregates for the first department being displayed in all the other departments, which is to be expected given that the only way I can access the Drawing objects is via the Drawings myDwgs = Estimate.Department[0].Drawing statement.  Is there any way to force the MS report to iterate through each child Drawing object when it iterates from one Department object to another?

JoeFallon1 replied on Monday, November 20, 2006

I would not expect report binding to work in this case. But there is no reason you cannot use your BO data to create a "flatter" representation that the report can bind to. e.g. Build a dataset from your BO data and bind the report to that. Or build 2 new BOs from the data that the report can bind to directly.

 

ajj3085 replied on Monday, November 20, 2006

I'm not sure how your report is setup, but did you setup the lists properly on the report?

Also, what about creating a view of your BOs that give department the summary data they need to show, if you don't want to bother with the Drawings collection on the report itself.

Copyright (c) Marimer LLC