ActiveReports 12
Connect to a Data Source
ActiveReports 12 > ActiveReports User Guide > How To > Page Report/RDL Report How To > Work with Data > Connect to a Data Source

In a Page report or an RDL report, you can connect to a data source at design time through the Report Explorer. Use the following instructions to connect to various data providers supported in ActiveReports.

These steps assume that you have already added a Page Report/RDL Report in a Visual Studio project. See Adding an ActiveReport to a Project for further information.

To connect to SQL, OLEDB, Oracle, DataSet, ODBC, and Object data sources

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the add button.
  2. In the Report Data Source dialog that appears, select the General page and enter the name of the data source. 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 Type, select the type of data source you want to use.
  4. Under Connection, enter a Connection String. If you select SQL, OleDB, or Oracle as the data source Type, Connection Properties, Connection String and Advanced Settings pages appear under Connection. If you select DataSet, ODBC, and Object data source Type, Connection Properties and Connection String pages appear. See Report Data Source Dialog for further details.
  5. Click the Validate Data Source icon to confirm the connection string. This icon becomes inactive to indicate success, while an error message indicates an invalid connection string.
  6. On the Credentials page, you can specify password, credentials, or Windows authentication.
  7. Click the OK button on the lower right corner to close the dialog. You have successfully connected the report to a data source.

To connect to an XML data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the add button.
  2. In the Report Data Source dialog that appears, select the General page and enter the name of the data source. 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 Type, select XML Provider.
  4. In the Connection Properties tab, select the type of XML data from the following options:
    • External file or URL: Enter the path of an external XML source such as a local file or the http location of a file.
    • Embedded: Enter the path of the XML file to embed in the report. You can also enter the data manually or edit the data in selected XML file.
    • Expression: Enter the path expression. User can enter expression in Connection String or in Expression field in Connection Properties.
  5. Click the Connection String tab. The connection string generated must include xmldoc or xmldata. You can validate the connection string by clicking the Validate DataSource icon. For more information on XML connection string, see topic XML Provider.
  6. Click the OK button on the lower right corner to close the dialog. You have successfully connected the report to a data source.

To connect to a CSV data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the add button.
  2. In the Report Data Source dialog that appears, select the General page and enter the name of the data source. 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 Type, select CSV Provider.
  4. In the Connection String tab, click the Build icon to open the Configure CSV Data Source wizard.
  5. Specify the File Path by clicking the Open button and selecting the .csv file.
  6. Set other options in the wizard to generate the connection string. For more information on CSV connection strings, see the CSV Provider topic.
  7. To edit the Name and Data Type of columns shown in the Preview area, click the Get from preview button. With Fixed data, you can also edit the Width.
  8. Click OK to save the changes and close the dialog. The Connection String tab displays the generated connection string. You can validate the connection string by clicking the Validate DataSource icon.
  9. Click OK on the lower right corner to close the dialog. You have successfully connected the report to a CSV data source. Note that the dataset for the CSV data source is added automatically.

To connect to a JSON data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the add button.
  2. In the Report Data Source dialog that appears, select the General page and enter the name of the data source. 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 Type, select JSON Provider. See JSON Provider for further details.
  4. In the Schema tab, specify the JSON schema file corresponding to your JSON data from the following options:
    • External file or URL: Enter the path or URL of an external JSON schema file or select the file from the drop-down which displays the JSON files available in the same folder as the report.
    • Embedded: Enter the path of the JSON schema file to embed in the report. You can enter the schema manually or edit the schema in the selected JSON file.
      For generating the JSON schema, use the JSON schema generator available at http://jsonschema.net/#/.
  5. In the Content tab, specify the JSON data file from the following available options:
    • External file or URL: Enter the path or URL of an external JSON data file or select the file from the drop-down which displays the JSON files available in the same folder as the report.
    • Embedded: Enter the path of the JSON data file to embed in the report. You can enter the data manually or edit the data in the selected JSON file.
    • Expression: Enter an expression to bind to the JSON data.
  6. Click the Connection String tab. The connection string generated must include jsondoc or jsondata and schemadoc or schemadata, depending on the options selected in Content and Schema tabs. You can validate the connection string by clicking the Validate DataSource icon. For more information on JSON connection string, see topic JSON Provider.
  7. Click the OK button on the lower right corner to close the dialog. You have successfully connected the report to the JSON data source.
See Also