ActiveReports 18 .NET Edition
Samples / Samples / Data Binding / Page and RDLX Reports / Object Data Source
In This Topic
    Object Data Source
    In This Topic

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

    Report bound to Object Data Source

    Sample Location

    Visual Basic.NET

    https://github.com/activereports/Samples18/tree/main/DataBinding/PageAndRDLX/ObjectDataSource/VB.NET

    C#

    https://github.com/activereports/Samples18/tree/main/DataBinding/PageAndRDLX/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.