How to Deploy SSRS Reports from Visual Studio to the SSRS Server

Normally, I work on SQL Server Reporting Services (SSRS) reports in Visual Studio until they are done, so I don’t need to deploy SSRS reports directly to the SSRS server. I say, “normally,” because recently I ran into an issue which meant enabling the publishing option within Visual Studio. I documented the process on how I did this in case you need to do the same thing too!

Enhansoft, where I’m the Chief Architect, specializes in SCCM reporting. Our products collect extra inventory details about computer warranties, computer monitors, local administrator group names, etc. Once these details are all inventoried and returned to SCCM, our customers need to see them in easy-to-read reports. After the reports are created, we test all of them on each version of SQL Server.

Our team knows that 99% of the time if there is an issue it will appear in Visual Studio and not the SSRS interface. Given this experience, we don’t usually test our reports within SSRS until after they are added to Enhansoft Reporting or Warranty Information Reporting.

Imagine our surprise, then, when we found an “SSRS” bug. That never happens! It turns out that vertical text was deprecated in SQL Server 2016. In order to restore the vertical text alignment, I needed to test some of our reports within the SSRS 2016 interface because Visual Studio didn’t display this text alignment problem. In fact, the reports looked great in Visual Studio, so that wasn’t helpful.

Error Message

Below is the error message I received in Visual Studio. It essentially told me that I needed to enable the publishing option in order to deploy SSRS reports to my SSRS server. If you see something similar, simply follow the steps in this post in order to make this error message disappear.

Microsoft SQL Server Report Designer

The specified report server URL http://localhost/reportserver could not be found. Verify the syntax of the URL and that the report server exists.

Deploy SSRS Reports - Error Message

How to Configure the Deploy SSRS Reports URL

Deploy SSRS Reports - Project Menu

Starting within Visual Studio, select the Project menu and then select Dev Reports Properties…

Deploy SSRS Reports - Property Pages

Make the following edits from the Property Pages window. Adjust each option to match your environment or to fit your needs.

OverwriteDatasets = True

OverwriteDataSources = True

TargetDatasetFolder = ES Dev Reports

TargetDataSourceFolder = ES Dev Reports

TargetReportFolder = ES Dev Reports

TargetReportPartFolder = ES Dev Reports

TargetServerURL = http://cm-cas-cb1/reportserver

TargetServerVersion = SQL Server 2016 or later

Notes:

  • The TargetServerURL is NOT the reports URL, which is normally used to view the reports. It is the reportserver URL.
  • For TargetServerVersion make sure that you select the appropriate SSRS version that you are hosting.

Once you complete the edits, click OK to continue.

How to Deploy SSRS Reports

Deploy SSRS Reports - Build Menu

Select the Build menu. Next, I selected Deploy Dev Reports. Keep in mind that your deploy menu item will be different from mine because it will match your project name. You can see within the title bar that my project is called Dev Reports.

Deploy SSRS Reports - Output Window

In order to confirm whether or not this was successful, you must review the Output window in Visual Studio.

In this example, you can see in the first section that the Dev Reports project was built. The second section tells me that all of my test reports were deployed to my SSRS server.

How to Run a Deployed SSRS Report

Deploy SSRS Reports - Run

In Visual Studio, locate the report that you want to run in SSRS from the Solution Explorer window. Right-click on the report’s name and select Run.

Deploy SSRS Reports - Default Browser

This will open your default browser with a link directly to the report itself. If you look at the URL it is using the ReportServer URL and not the normal Reports URL. This is exactly what you want to see!

Deploy SSRS Reports - SSRS Site

There’s one last thing I need to point out. In the Reports URL, notice that my ES Dev Reports folder is at the root of my SSRS site and not within the ConfigMgr_CB1 folder? If I want these reports to be within the ConfigMgr_CB1 folder (and therefore within the Configuration Manager console) I must edit the path. In order to do this, I change the path to: ConfigMgr_CB1/ES Dev Reports. Now, I can publish the reports within the Configuration Manager console.

These simple steps allow you to directly deploy your SSRS reports to your SSRS server. If you have any questions, please feel free to contact me at @GarthMJ.

 

Comments
pingbacks / trackbacks
  • […] Normally I don’t deploy my SSRS reports directly to my SSRS server, but in this instance, I had to do just that. This also meant additional work because I first needed to setup my lab in order to deploy SSRS reports to my server. In case you want to do the same, check out my blog post, “How to Deploy SSRS Reports from Visual Studio to the SSRS Server.” […]

Leave a Comment