ActiveReports 6 Online Help
Modify Data Sources at Run Time
Show AllShow All
Hide AllHide All

ActiveReports allows you to modify your data source at run time. Below is sample code that you can use to connect a report to the Nwind.mdb sample database at run time.

To find the database path

  1. Right-click in any section of the design window of the report, and select View Code to display the code view for the report.
  2. Add code to the report to get the sample database path from the registry.

To write the code in Visual Basic

To write the code in C#

To change the data source at run time

  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 change the data source at run time.

To write the code in Visual Basic.NET

To write the code in C#

To close the data connection

To write the code in Visual Basic

To write the code in C#

See Also

Walkthroughs

Concepts