7.4. Passing Own Connection String

If you use data sources that are defined inside a report, you may need to pass an application-defined connection string to a report. This can be done in three ways.

The first method: you pass a connection string directly to the Connection object in a report. Do the following:

// do it after loading the report, before running it
// assume we have one connection in the report
report1.Dictionary.Connections[0].ConnectionString = my_connection_string;

The second method: you pass a connection string using the report parameter. Do the following:

Configuring the Environment Top Page Passing Custom SQL