In a or an , 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
- 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.
- 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.
- Under Type, select the type of data source you want to use.
- 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.
- 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.
- On the Credentials page, you can specify password, credentials, or Windows authentication.
- 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
- 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.
- 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.
- Under Type, select XML Provider.
- 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.
- 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.
- 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
- 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.
- 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.
- Under Type, select CSV Provider.
- In the Connection String tab, click the Build icon to open the Configure CSV Data Source wizard.
- Specify the Path by clicking the Open button and selecting the .csv file available locally, or via URL for centrally located CSV data source.
- Set other options in the wizard to generate the connection string. For more information on CSV connection strings, see the CSV Provider topic.
- 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.
![](images/CsvDataSourceWizard_Page.png)
- 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.
- 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
- 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.
- 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.
- Under Type, select JSON Provider. See JSON Provider for further details.
- 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/#/.
- 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.
- 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.
- 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