Tutorial: Specify connection information (Reporting Services)
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:
- Add the
AdventureWorks2022
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 SQL Server Database Engine 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.
The Data Source Properties dialog opens with the General section selected.
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 SQL Server Data Tools (SSDT), the report server, and the
AdventureWorks2022
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 SQL Server Express 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.