The Object Data Source sample demonstrates how to use Object provider for binding a report that contains a subreport.
Visual Basic.NET |
Copy Code
|
---|---|
<User Folder>\Documents\GrapeCity Samples\ActiveReports 12\Page Reports And RDL Reports \Data\ObjectDataSource\VB.NET |
C# |
Copy Code
|
---|---|
<User Folder>\Documents\GrapeCity Samples\ActiveReports 12\Page Reports And RDL Reports \Data\ObjectDataSource\C# |
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).
This file is an internal class that contains code to provide data for the report.
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.
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.
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.