write C# code to create pdf files from SSRS reports; what is best practice; write console application and etc

Joseph Kashishian 0 Reputation points
2023-02-10T18:43:03.29+00:00

I would like to write C# console or some project type from Visual Studio that will create PDF files on our network from SSRS Reports; It needs to be part of a job or task that runs every night; What is the best Visual Studio project to use? What is the library I can use to tap into the SSRS Reports with passing parameters from a table?

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.
2,798 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AniyaTang-MSFT 12,311 Reputation points Microsoft Vendor
    2023-02-13T08:45:51.04+00:00

    Hi @Joseph Kashishian

    Sorry I'm not very familiar with C#, I'm in charge of SSRS related issues.

    Do you mean want to export SSRS report as Pdf file as per schedule? If it's a single file, you can use file sharing to deliver it.

    https://learn.microsoft.com/en-us/sql/reporting-services/subscriptions/file-share-delivery-in-reporting-services?view=sql-server-ver16

    If you want to use C#, you can refer to this link: https://social.msdn.microsoft.com/Forums/en-US/fb61c11b-f873-4924-9ef4-dbb694fed580/how-to-export-the-ssrs-reportxls-or-xlsx-format-at-given-physical-location-through-c-code?forum=sqlreportingservices.

    Best regards,

    Aniya

    0 comments No comments

  2. Joseph Kashishian 0 Reputation points
    2023-02-13T14:08:01.6466667+00:00

    trying to SSRS report as Pdf file but trying to do it thru asp.core console application.

    After I connect to the WEB Services ReportServer/reportexecution2005.asmx

    I'm having issues getting libraries or namespaces to work with the code. in the console application I want to read 2 parameters and go thru a loop on a table with to read parameters, execute the ssrs report and export to pdf. I did this years ago but I think the libraries have changed