In a , 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 Layout template in a Visual Studio project. See Adding an ActiveReport to a Project further information.
- 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 Data Source1. 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 value, Connection Properties, Connection String and Advanced Settings pages appear under Connection. See Report Data Source Dialog for further details.
|
Note: When you select an XML Provider under Type, the connection string must include XmlDoc or XmlData. Use of TransformationDoc is optional. See details of each of these connection string types below:
Connection String
- XmlDoc: Refers to a specific XML file located on either the file system or at a web-accessible location. For example,
XmlDoc=C:\MyXmlFi le.xml;
- XmlData: Provides specific XML data in the Connection String itself. For example,
XmlData=<people>
<person>
<name>
<given>John</given>
<family>Doe</family>
</name>
</person>
<person>
<name>
<given>Jane</given>
<family>Smith</family>
</name>
</person>
</people>;
- TransformationDoc: Refers to a specific XSLT file to apply to the XML data.
Note that elements in the Connection String must be terminated with a semicolon (;) character.
|
- 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.
In ActiveReports, you can connect to most data sources with these steps. However, you need to follow the instructions below to connect to a Shared Data Source.
Connect to a Shared 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. This name appears as a child node to the Data Sources node in the Report Explorer.
- Check the Shared Reference checkbox on.
- Under Reference, click the Browse button and from the Shared Data Source File dialog that appears, go to the folder where your shared data source file is located and select it. A file path appears in the field adjacent to the Browse button.
- Click the OK button on the lower right corner to close the dialog. A shared data source node appears in the Report Explorer.
See Also