How to: Create an Embedded or Shared Data Source

In Report Designer, a data source specifies a name, a location, and a connection string. Reporting Services supports two types of data sources: embedded and shared. An embedded data source is defined within a report definition and used only by that report. A shared data source is defined as a separate item and can be used by multiple reports. An embedded source can only be created in Report Designer. A shared data source can be created in Report Designer or Report Manager. After you publish a report, both embedded and shared data sources are managed independently from the report definition.

Use the Report Data pane in Report Designer to view all data sources that are used in the report. These data sources may be embedded, or may be a reference to a shared data source. Use Solution Explorer to view shared data sources. You can convert an embedded data source to a shared data source.

To create an embedded or shared data source

  1. On the toolbar in the Report Data pane, click New and then click Data Source. The Data Source Properties dialog box opens.

    Note

    If the Report Data pane is not visible, click Report Data on the View menu.

  2. In the Name text box, type a name for the data source or accept the default.

    Note

    The data source name is used internally within the report. For clarity, we recommend that the name of the data source contain the name of the database specified in the connection string.

  3. For an embedded data source, verify that Embedded connection is selected.

    1. From the Type drop-down list, select a data source type; for example, Microsoft SQL Server or OLE DB.

    2. Specify a connection string using one of the following alternatives:

    • Type the connection string directly in the Connection string text box. For a list of example connection strings, see Connecting to a Data Source (Reporting Services).

    • Click the expression (fx) button to create an expression that evaluates to a connection string. In the Expression dialog box, type the expression in the Expression pane. Click OK.

    • Click Edit to open the Connection Properties dialog box for the data source type you chose in step 2.

      Fill in the fields in the Connection Properties dialog box as appropriate for the data source type. Connection properties include the type of data source, the name of the data source, and the credentials to use. After you specify values in this dialog box, click Test Connection to verify that the data source is available and that the credentials you specified are correct. For more information about specific data source types, see topics in Connecting To Report Data How-to Topics.

  4. For a shared data source, verify that Use shared data source reference is selected.

    1. Click New. In the Shared Data Source properties dialog box, follow steps 2 and 3 to create a new data source.

    2. Click OK. 

      The new shared data source appears in the Shared Data Sources folder in Solution Explorer.

  5. Click OK.

    The data source appears in the Report Data pane. For a shared data source, this is a new data source that contains a reference to the data source that is displayed in Solution Explorer.

To import an existing data source

  1. In Solution Explorer, right-click the Shared Data Sources folder in the report server project, and then click Add Existing Item. The Add Existing Item dialog box opens.

  2. Navigate to an existing Report Definition Shared data source (rds) file and then click Open.

  3. Click OK.

To convert an embedded data source to a shared data source

  • In the Report Data pane, right-click the data source and then click Convert to Shared Data Source.