Connecting to ODBC Data Source with The Report Viewer (Step by Step)

UPDATE FOR 2019:
Please note that in newer versions of The Report Viewer (TRV), you may need to enter the ODBC DataSource Name (DSN) in the "server" field and the actual Database Name in the "database" field. This differs from previous advice, and may vary depending on the database vendor. For many SQL Server installations, we have found that entering the DSN in the "server" field and the actual Database Name in the "database" field works correctly. If you have any difficulties setting up your connection, please contact us for assistance. It may be helpful to send a report without saved data, so we can see how the report was designed to connect to the database.

Below are the previous instructions for connecting to an ODBC data source using TRV. These steps are still relevant and may help you understand how TRV accesses your database.

OPTION 1: SETTING UP CONNECTION WITH THE CONNECTION SETTINGS EMBEDDED IN THE REPORT

  1. Check the report and identify the DSN that it references.
  2. Set up a 32-bit ODBC driver with the same DSN as the name. Note that the DSN value is case-sensitive.
  3. If you are using a 64-bit operating system, make sure to run the 32-bit ODBC administrator (e.g. C:\Windows\SysWOW64\odbcad32.exe).
  4. Close any open reports in TRV.
  5. Open TRV and select "use embedded connections" in the connections dropdown.
  6. Refresh the report.

If these steps do not work, try the following troubleshooting steps:

  1. Go back to the ODBC driver you created and test the connection.
  2. Test the ODBC connection using other software.

OPTION 2: OVERRIDING THE ODBC DATABASE CONNECTIONS THAT ARE EMBEDDED IN THE REPORT

  1. Set up a 32-bit ODBC driver, remembering to use the DSN that was used to create the driver. Note that the DSN value is case-sensitive.
  2. If you are using a 64-bit operating system, make sure to run the 32-bit ODBC administrator (e.g. C:\Windows\SysWOW64\odbcad32.exe).
  3. Close any open reports in TRV.
  4. Create a new connection in TRV.
  5. Add a nickname for this connection, and enter the username and password.
  6. Set the "Server" and "Database" values to the DSN field of the ODBC driver you set up earlier. Note that these values are case-sensitive.
  7. Save this connection.
  8. Select the connection you just saved in the connections dropdown.
  9. Open your report again and refresh the data.

Note: Make sure to reopen the reports every time you change the connection settings, as the connection settings are only applied once when the report is opened. This process can be slow, so it is best to avoid changing the connection settings multiple times in a single session.