I have a list of objects whose members each have a list of objects. For example, given the following 2 classes:
Class Phone
string AreaCode
string Description
string Number
Class Employee
string FirstName
string LastName
List<Phone> Phones
I then have multiple Employees, each with multiple Phones:
List<Employee> Employees
I'm tasked with creating an RDLC report to list the data. The format would be similar to:
First Name Last Name Phone.Description-1 Phone.Description-2 ... Phone.Description-n
FirstName LastName Phone.Number-1 Phone.Number-2 ... Phone.Number-n
FirstName LastName Phone.Number-1 Phone.Number-2 ... Phone.Number-n
FirstName LastName Phone.Number-1 Phone.Number-2 ... Phone.Number-n
I don't know how many Phones (in this example) are going to be returned from the database.
Note that the header above the Phone.Number columns are also from
List<Phone>
While these are from the database as well, they will be the same across all members of
List<Employee>.List<Phone>
(i.e. Employee1-Phone1, Employee2-Phone1, and Employee3-Phone1 will all have the same Phone1 header).
I can create an RDLC report using a
List<Employee>
as its datasource, but have been unable to find a way to then incorporate the
List<Employee>.List<Phone>
on the same row as its parent Employee.
Is this doable in an RDLC Matrix? Or is there an "auto-generate columns" type of functionality that can be utilized?
Thank you for any help/direction/suggestion you can provide.
Addendum: I should mention that the DataSet returned from the database is exactly the format I need. However, as I don't know how many "Phone" columns will be returned, I don't have a definable schema, therefore, I cant create the report in the designer. By the same token, I can't set the datasource to the DataSet programatically, as there is no schema/grid defined on the report.