This is a migrated thread and some comments may be shown as answers.

Binding to object with child objects

2 Answers 319 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Justin Lee
Top achievements
Rank 1
Justin Lee asked on 19 Jul 2011, 07:17 PM
I have a report that is bound to a business object list.  The business object class contains a list of child objects.  Example:  The parent object is Company, and the Company class contains a list of Employees.  The report shows the details of each company, and the list of employees for each company.  This senario fits the use of a SubReport.  However, is there a way to do this without a SubReport?  And if not, is there a way to pass the child items to the subreport, instead of the ID of the company?  (since the child objects are already populated in the Company object, if I pass the ID of the company, the Employee list will have to be retrieve a second time)

Thanks,
Justin

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 20 Jul 2011, 04:57 PM
Hi Justin Lee,

The subreport items are not mandatory for utilizing business objects with child collections. Generally any data item (Table, Crosstab, List, Subreport and Chart) can use nested lists. In order to pass directly the child collection our suggestion is to set binding to the child data item's DataSource property as shown in the following example:

 Property path Expression 
 DataSource  =Fields.MyChildCollection
 
Greetings,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Justin Lee
Top achievements
Rank 1
answered on 20 Jul 2011, 05:17 PM
Excellent. I knew I was missing something.  Thanks!
Tags
General Discussions
Asked by
Justin Lee
Top achievements
Rank 1
Answers by
Peter
Telerik team
Justin Lee
Top achievements
Rank 1
Share this question
or