ActiveReports 11
Object Data Source
ActiveReports 11 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Page Reports And RDL Reports > Data > Object Data Source

The Object Data Source sample demonstrates how to use Object provider for binding a report that contains a subreport.

Sample Location

Visual Basic.NET
Copy Code
<User Folder>\Documents\GrapeCity Samples\ActiveReports 11\Page Reports And RDL Reports
\Data\ObjectDataSource\VB.NET
C#
Copy Code
<User Folder>\Documents\GrapeCity Samples\ActiveReports 11\Page Reports And RDL Reports
\Data\ObjectDataSource\C#

Run-Time Features

When you run this sample, the MainForm with the ActiveReports Viewer appears. The viewer displays the report where YearReleased column is a part of the main report (ObjectsReport.rdlx) whereas other columns such as ID, Title and MPAA are part of the subreport (SubObjectsReport.rdlx).

Project Details

DataLayer

This file is an internal class that contains code to provide data for the report.

MainForm

This is the main form that appears when you run this sample. It uses the ActiveReports Viewer control to display the report at run time.

Right-click the form and select View Code to see how to load and show the report at run time.

ObjectsReport.rdlx

This is the report that gets displayed in the Viewer at run time.

The report uses the header with the Textbox to display the report heading and the footer with a Textbox to display the page number information. The body of the report has the Table data region to display data where only first column is obtained from the Objects data provider. For that, the Textbox controls of the Table are bound to the Objects data source in the Value property. For rest three columns, subreport control is used.    

SubObjectsReport.rdlx

This is the subreport that is placed on Table data region of the main report.

The report has a Table data region to display data obtained from the Objects data provider. Here also, the Textbox controls of the Table are bound to the Objects data source in the Value property.