
Private void detail_Format(object sender, EventArgs e) Private void rptTeam_FetchData(object sender, FetchEventArgs eArgs) To show the team name on the main report Private void NewActiveReport1_ReportStart(object sender, EventArgs e) To set the datasource for main report and the subreport we will use the ReportStart, Detail_Format and the FetchData events in the following way: //Create the sub report object Add the teams and their corresponding players Now we need to populate them with data, so we will write a function GetData() something like below: public IList GetData() The first thing which we need to do is to create two classes which will hold name of players and the teams. Here is a output of the report which we will get:

Separate classes and properties can be created for the team and the players to ensure that the data is displayed correctly and in a simple fashion. Considering the above example, when binding it to the report we can show the team names in the main report and the player names in the subreport. This is a very basic example of nested collection of objects where the top level contains the details of the teams and then in the next level each team has its own players. Now for each team there would be multiple players. For example lets consider that we are planning for a games event and different teams are participating. To bind a report to a nested IList we can use subreports to handle the inner list objects. However, in this article I would like to talk more about a complex/nested IList.

Default location for the sample is "My Documents\ComponentOne Samples\ActiveReports Developer 7\Section Reports\C#\IListBindingSample ". A sample is included with ActiveReports 7 installer which demonstrates this.

And, it is quite common to use an IList or a collection of objects as the data source for a report. ActiveReports supports different types of data sources.
