ActiveReports 6 Online Help
Unbound Reporting

Show AllShow All
Hide AllHide All

ActiveReports allows you to bind reports to any type of data source, including arrays. You can create a report without setting its data source, then load the data into the control at run time. Use the ReportStart event to set up your data source, the ReportEnd event to close it, the DataInitialize event to create your fields collection, and the FetchData event to populate it.

Use the ReportStart event to connect the report to a data source

  1. Double-click in the gray area below the report to create an event-handling method for the ReportStart event.
  2. Add code to the handler to:
    • Set the database path (place this code above the ReportStart event)
    • Set the data source connection string
    • Set the data source SQL query
    • Open the connection to create the DataReader

The following examples show what the code for the method looks like.

Add using or Imports statements for System.Data and System.Data.OleDb.

To create a GetDatabasePath method in Visual Basic.NET

To create a GetDatabasePath method in C#

Use the ReportEnd event to close the data connection

The following examples show what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

Use the DataInitialize event to add fields

The following examples show what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

Use the FetchData event to populate fields

Reference the Fields collection only in the DataInitialize and FetchData events.

The following examples show what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

See Also

Walkthroughs

Getting Started

How To