Bulk generating SSRS reports by C# application

We send a specific report to our customers every month. This report is generated by SQL Server Reporting Services on SQL Server 2014. The report has a parameter called Category which determines a project for which is the report generated. This parameter is dynamically generated because we send reports only for project with some activity in last month. That’s why we cannot use SSRS standard subscription function. The only standard way how to generate the report for all projects is clicking it by hand. This is time-consuming because there are usually more than one hundred projects to report. The other problem is that user could make an error and skip some project. This error would be hard to track in further process.

I decided to solve this by C# command line application. This application loads all active projects in last month. Then it generates the report in XLS format for each project. The generated files are stored in a program’s directory. The program is quite simple as you can see from the following source code.