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

Using Reports to display items from nested Lists

1 Answer 928 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Abhay
Top achievements
Rank 1
Abhay asked on 12 Nov 2010, 11:50 PM
I am creating a report by using a .Net List collection as a DataSource. The primary list includes some properties which are themselves a collection (List<string>). Does Telerik reporting support support Collections within collections?

Following is a simple example which can recreate the issue. When I created a report that binds to List<AddressEntry> as a DataSource, , it lists out the each AddressEntry (Name, Address, PhoneNo) but does not list the multiple Contacts within the address. I have tried item bind to Fields.Contacts and Fields.Contacts.Item, neither of which had success is listing the Contacts.

            List<AddressEntry> entries = new List<AddressEntry>();

//populate the individual address entries, each address can have multiple contacts.
....

    public class AddressEntry
    {
        public string Name {get;set;}
        public string Address {get;set;}
        public List<string> Contacts { get; set; }
        public string PhoneNo { get; set; }
    }

Thanks for the response,

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Nov 2010, 10:39 AM
Hi Abhay,

In order to access the nested properties you have to use a separate data item(Table, List, Crosstab or SubReport item) and set the data item Datasource with a Binding to the nested property.

Please review the following forum thread that elaborates on your inquiry: Data Source Business Objects.

Greetings,
Peter
the Telerik team
See What's New in Telerik Reporting in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
Tags
General Discussions
Asked by
Abhay
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or