Summary

When exporting a report using Report Commander, it is possible to override the database connection information stored in the report, to pull data from a diferent data source. This feature is not discussed in the Report Commander documentation.

Details

You can use the "logon" command-line parameter for Report Commander to change the database that a report uses. You can only change to use a different database of the same kind as the original database connection. For example, if the report uses a SQL Server database, you can use a different SQL Server database at runtime, but you cannot change to an Oracle database.

The "logon" parameter for Report Commander usually have the following the syntax:

-login=userID:password

An alternate syntax allows you to override the database connection string information for the connection:

-login=connectionInfo:userID:password

The content of the connectionInfo segment of the parameter differs depending on the database driver being used by the report.

For a SQL Server database, the syntax is

-login=servername.databasename:userID:password

For an Oracle database, the syntax is

-login=databaseName:userID:password

For an ODBC database, the syntax is

-login=ODBC_Alias:userID:password

The syntax for other databases will be similar. To deduce the proper syntax, open the report in the Report Commander Command-Line Builder and go to the Database Logins tab. Edit the connection and note the connection syntax shown in the Connection box. Replace the appropriate parts of this value to create the new connection string.

Note: The same syntax can be used when you are using the "-login!=" form of the login parameter, e.g.,

-login!=connectionInfo:userID:encryptedPassword

Status

A future version of Report Commander will include the ability to change connection information in the Command-Line Builder.