Reputation: 3419
I have an MVC 5 application that gathers parameter information and invokes the SSRS Report Execution Service SOAP interface to generate the report and download it to the user as an Excel spreadsheet.
For longer-running reports, ideally, I would like to include an email address in the report execution call so that SSRS will accept the request, run the report asynchronously, and then deliver the result as an attachment to the email address included in the request.
Most information I found regarding email delivery revolves around Subscriptions. However, I do not see any way to establish an "On-Demand (one-time)" Recurrence Pattern, or how to pass in an email address.
A co-worker advised me to use Subscriptions and assign odd times, so that I can use the time to identify the GUID that SQL Server will assign the job. Then, using the GUID, enable or disable the job as needed. This is based on his general knowledge of SSRS, never having done this kind of thing himself. The approach seems pretty kludgey.
I don't want to head down that road if there is a better way to accomplish the task.
Can someone point me toward a better approach and, perhaps, some resources for doing this through the SSRS SOAP services?
Upvotes: 1
Views: 1137
Reputation: 20560
The easiest way to solve this problem in my opinion is to use the ReportExecutionService.Render
method to render the report via code. Once you have created the report in this way you can do whatever you want with it. I use this to run reports and attach them to emails automatically based on my own scheduling program rather than use the SSRS scheduler.
The MSDN site has some code to get you started.
Upvotes: 1