In previous article we created a project and empty report in the BI tool SSDT (SQL Server Data tools) – Part 1 -SSRS project and report creation. It was a kind of preparation for this part in which we will configure the report to be able to query a database (SQL Server database in our case). We will find out how to configure data source in SSRS.

How to Configure Data Source in SSRS

Previous part ended by having correctly created project and empty report, as seen in the screenshot:

This is how your project should look like now. To allow the report to extract data from a database we configure connection to a data source database.

Configuration of shared (project) Data source in SSRS

We create connection to the data source by creating new “Data source” (as shown below). Data source will be the SQL database. There are 2 options how to create a source:

  1. Individual Data source for a report – There is an option to set a data source for each report independently. If you create it this way, you will not be able to use it for another report.
  2. Shared data source – In this case, we create share data source for the whole project. If you expect to have more reports in a project that will use the same database, this is the way to go. But take in mind that you cannot run reports individually (you have to deploy a project).

SSRS data source
[1] Individual and shared data source explanation
Let’s create shared project data source to which we will set credentials. In the solution explorer, click on Shared Data sources – Add new data source. In the next screen, give a name to your data source and click on Edit.

SSRS Shared data source creation
[2] Shared data source creation
Naming the data source in ssrs
[3] Naming the data source
Here the actual connection configuration to the database takes place. We firstly select the SQL instance. My instance is named “MOJEINSTANCE” and I chose Windows authentication login. In case you have user name and password. Then we select database from which we will extract the data [4]. After the configuration it is suitable to test whether the connection to the database works. You can do that by clicking on Test connection [5]. If everything is OK, save the data source and it is done. You should see it in the solution explorer [6].

SSRS create connection - SQL Instance a database
[4] Creating connection – SQL Instance a database
ssrs Test connection
[5] SSRS Data source Test connection
ssrs Final Data source
[6] Final SSRS Data source

Setting Reference from Shared to Report Data Source

We have set up shared dataset to which we can create a reference in any report inside the project. The final step to go through is adding the reference in our report to shared Data source. In report data section click on Data source – Add new data source [7]. Name the data source (caution – no spaces) and use option “Use shared data source reference” [8]. The result should be a view on BI project identical to the one in the picture [9]. (Sorry about text in Czech, this article comes originally from my czech written blog. Anyway I belive it helps)

Creating data source for the report
[7] Creating data source for the report
Reference to a Shared Dataset in our SSRS project
[8] Reference to a Shared Dataset in our project
Final reference to shared (project) data source
[9] Final reference to shared (project) data source

Rate this post

Ing. Jan Zedníček - Data Engineer & Controlling

My name is Jan Zedníček and I have been working as a freelancer for many companies for more than 10 years. I used to work as a financial controller, analyst and manager at many different companies in field of banking and manufacturing. When I am not at work, I like playing volleyball, chess, doing a workout in the gym.

🔥 If you found this article helpful, please share it or mention me on your website

Leave a Reply

Your email address will not be published. Required fields are marked *