title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | |
---|---|---|---|---|---|---|---|---|---|
Tutorial: Specify connection information (Reporting Services) |
In this lesson, you define a data source: connection information the report uses to access data from a relational database or other sources. |
kfollis |
kfollis |
09/25/2024 |
reporting-services |
reporting-services |
tutorial |
|
After you create your project and report definition file, you define a data source and configure connection information for the report to access data from a relational database or other sources.
In this tutorial, you:
[!div class="checklist"]
- Add the [!INCLUDE sssampledbobject-md] sample database as your data source.
- Configure the connection string for the data source.
- Completion of Step 1: Create a report server project.
- Ensure the database is in the default instance of [!INCLUDEssNoVersion] [!INCLUDEssDE] and installed on your local computer.
- Access to the AdventureWorks2022 sample database.
When you create reports in SQL Server Reporting Services (SSRS), establishing a data source is crucial. Follow these steps to set up a connection between a data source and your reports.
-
Open your Sales Order report definition file (.rdl) in Visual Studio.
-
In the Report Data pane, select New > Data Source. If the Report Data pane isn't visible, then select View > Report Data.
:::image type="content" source="media/ssrs-table-tutorial-2-new-data-source.png" alt-text="Screenshot of the Report Data pane with the Data Source option highlighted.":::
The Data Source Properties dialog opens with the General section selected.
:::image type="content" source="media/lesson-2-specifying-connection-information-reporting-services/vs-datasource-connection-properties-dialog-box.png" alt-text="Screenshot of the Data Source Properties dialog.":::
-
In the Name box, enter "AdventureWorks2022".
-
Select Embedded connection.
-
From the Type list, select Microsoft SQL Server.
-
In the Connection string box, enter:
Data source=localhost; initial catalog=AdventureWorks2022
[!NOTE] This connection string assumes that [!INCLUDEssBIDevStudioFull], the report server, and the [!INCLUDE sssampledbobject-md] database are all installed on the local computer.
Change the connection string and replace "localhost" with the name of your database server/instance if the assumption isn't true. If you use [!INCLUDEssExpress] or a SQL Server named instance, modify your connection string to include instance information. For example:
Data source=localhost\SQLEXPRESS; initial catalog=AdventureWorks2022
-
Select Credentials. Choose the Use Windows Authentication (integrated security) option.
-
Select OK. Report Designer adds the AdventureWorks2022 data source to the Report Data pane.
:::image type="content" source="media/lesson-2-specifying-connection-information-reporting-services/ssrs-adventureworks-data-source-2022.png.png" alt-text="Screenshot of the Report Data pane that highlights the AdventureWorks2022 data source.":::
[!div class="nextstepaction"] Step 3: Define a dataset for the table report (Reporting Services)