ActiveReports 18 .NET Edition
Report Authors: Designer Components / Data Binding / Data Binding in Page/RDLX Reports / Connect to a Data Source / Microsoft ODBC Provider / Connect to PostgreSQL Database
In This Topic
    Connect to PostgreSQL Database
    In This Topic

    This article demonstrates how to connect to a PostgreSQL database with the ODBC driver. The following steps assume that you have the required configuration details to connect to a PostgreSQL database.

    You will need to install the PostgreSQL ODBC driver that will allow you to connect with PostgreSQL data.

    Install the PostgreSQL ODBC driver

    1. Download the latest 32-bit version of Postgres ODBC driver.    
      Note: Since the ActiveReports Designer application is a 32-bit application, you should use the 32-bit PostgreSQL ODBC driver. In case you are using the ActiveReports Visual Studio Integrated Designer in your .NET application, depending on the target platform x86 or x64, you need to accordingly download a 32-bit or a 64-bit PostgreSQL ODBC driver.
    2. Extract the files and run the .msi file.

    Set up the ODBC data source for PostgreSQL

    1. Open the ODBC Data Source application. An ODBC Data Source Administrator dialog box appears.
    2. Navigate to the System DSN tab and click Add.
      ODBC Data Source Administrator dialog box
    3. In the Create New Data Source dialog box that displays, select the PostgreSQL Unicode driver from the list, and click Finish.
      Select the PostgreSQL Unicode driver from the Create New Data Source dialog box
    4. Fill in the configuration details required for the PostgreSQL including the server, port, username, password, and database. The configured DSN is PostgreSQL35W as shown.
      Fill in the configuration details for PostgreSQL
    5. Click Test to verify the data source connection. The following dialog box will appear on a successful connection.
      Successful Data Source Connection
    6. Click OK to save the changes.

    Connect to PostgreSQL with the ODBC connection string

    1. Open the ActiveReports Designer application. By default, an RDLX report is created.
      As you create a new report, Report Data Source dialog appears for you to configure the report data connection. You can also access this dialog by right-clicking the Data Sources node in the Report Explorer and then selecting the Add Data Source option.
      Add a new data source from the Report Explorer
    2. In the Report Data Source dialog, select the General page and enter the name of the data source in the Name field.
    3. Under the Type field, select Microsoft Odbc Provider.
    4. On the same page, under the Connection section, enter the connection string to connect to the data source.
      The format of the connection string is as follows -
      Connection String
      Copy Code
      DSN=PostgreSQL35W;Server=<server>;Port=<port>;User Id=<user id>;Password=<password>;Database=<database>