ActiveReports 18 .NET Edition
Report Authors / Data Binding / Data Binding in Page/RDLX Reports / Connect to a Data Source / PostgreSQL
In This Topic
    PostgreSQL
    In This Topic

    This article explains connecting a Page or an RDLX report to the PostgreSQL data source. You can connect to this data source while creating a new report (via report wizard) or using report explorer (via report data source dialog).

    Connect to PostgreSQL Data Source using Report Wizard

    The steps to connect to the PostgreSQL data source are:

    1. Create a New Report.
    2. In the New Report dialog, choose the Report Type as RDLX, RDLX Dashboard, or Page and click Next.
      Choose a Report Type from New Report Dialog
    3. Select the Data Source Type as PostgreSQL and click Next.
      Select the Data Source Type as PostgreSQL
    4. Enter the server connection details, including Server name, Database, Port, User name, and Password.
      Enter the server connection details
    5. To specify the runtime connection values, let us add the parameter for Database.
      1. Click Parameter to open the Parameters dialog.  and then click the Add button to add a new parameter.
      2. Specify the below details:
        • Name: Specify the name of the parameter.
        • Type: Select the value type (string by default) from the drop-down list.
        • Testing Value: Specify the runtime value for the connection properties.
        • Input Source: Select Interactive for non-hidden parameters and Programmatic for hidden parameters from the drop-down list.
      3. Click OK to finish adding the parameter.          
    6. For additional configuration, for example, setting UI timeout option to allow entering key-value pairs, select Advanced properties.
    7. Click Test Connection to test the connection.    
    8. Click Next and configure the dataset to retrieve the fields.
    9. Click Insert parameter to specify the interactive parameter 'rentalrateParam', to set the value of 'rental_rate' field of type 'Float', to '4.99'.
      Parameters Dialog
    10. You should add a valid query that utilizes the parameter added. Validate the query and click Next.
      Enter a valid query
    11. On the final screen of the Report Wizard, review the summary of the report and click Finish to successfully add the report with the PostgreSQL data source.
      Review and confirm the report summary   

    Connect to a PostgreSQL Data Source using Report Data Source dialog

    1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or click the Add button and select the Data Source option.    
    2. In the Report Data Source dialog that appears, select the General page and enter the data source name in the Name field. By default, the data source name is set to DataSource1. This name appears as a child node to the Data Sources node in the Report Explorer.    
    3. Under the Type field, select PostgreSQL Provider.
      Report Data Source Dialog Box for PostgreSQL Data Provider
    4. On the same page under the Connection section, enter the connection string to connect to the PostgreSQL data source. For example:

      host=10.64.1.240;port=5432;database=postgres;username=postgres;password=********;
        
    5. Verify the generated connection string by clicking the Validate DataSource iconValidate Icon.
    6. Click OK to save the changes and close the Report Data Source dialog box.