Use SSRS 2017, 2019 REST API to render report and save as pdf programmatically

Spunny 366 Reputation points
2022-02-24T14:08:01.443+00:00

Hi,
We need to run SSRS report by passing parameter and generate PDS as stream and attach it as PDF to the email. We need to do it in powershell script.
When searching, finding mixed articles. ReportExecutionService2005, ReportExecutionService2010.asmx etc. With 2017, I see REST API is introduced. But I am not finding any information to render report and save as pdf programatically.

Can someone please point me to right source for rendering SSRS report and save as pdf with SSRS 2017 or SSRS 2019.

Thank You

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
0 comments No comments
{count} vote

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2022-02-24T15:52:26.573+00:00

    The API is documented here. Since it is an OpenAPI you can import this URL into Postman or your favorite API testing tool to get a feel for what is available. But SSRS is divided into 2 pieces: management and execution. The API appears to only be the management side so you can create and modify reports but not execute them.

    To render a report you can either use the SOAP service ASMX or the URL access approach. Personally I prefer the SOAP service as it is more flexible. You would use Connected Services to point to the ASMX endpoint. Visual Studio auto-generates a wrapper client that you can then use. We have this wrapped in a reusable library for our company so not every project needs a connected service endpoint. After that you simply need to call the Render method on the server client with the report information, optional credentials and rendering options you have.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.