CHAPTER 10 MANAGING REPORTS
- Data sources and connections
- Report parameters
- Report rendering
- Report history
- Report scheduling
- Report subscriptions
- Linked reports
Adding Subscription Functionality to SSRS Viewer
You’ve already used the Report Server Web service to provide a list of report parameters and their
possible values and to deploy reports in Chapters 8 and 9. In this chapter, you’ll learn how to use the
Report Server Web service to schedule reports to run automatically each morning before the office
opens.
As you saw in the earlier part of this chapter, you can set up subscription services through the user
interface of the report server itself. You may, however, want to provide this functionality within your
customized Windows Forms (or Web) application. In the example, you’ll expand on the previous
Windows Forms application to allow users to provide the parameters that they want to run the report
with, as well as schedule the time to run the report and indicate the delivery mechanism to use.
In the example, you’ll allow the users to pick only a shared schedule that has already been defined
by the systems administrator. Because you want centralized control over when scheduled reports will be
run, you won’t give users the ability to define their own schedules. You’ll also allow them to trigger a
subscription based on a snapshot. This allows them to receive their subscribed report whenever a
snapshot is created for it. See the “Creating Snapshots for the Report History” section earlier in this
chapter for details.
Before you run the included examples, make sure to read the ReadMe.htm file. It is located in a file
in the samples root folder. If you have the code open in Visual Studio, it will be under the Solution Items
folder. It contains setup and configuration steps that are required before running the examples.
Accessing an Existing Shared Schedule
If you are walking through this code, start by opening the project from Chapter 9, as it will serve as the
starting point for our additions. After you have the solution, open the SSRS Viewer RVC project, and
complete the following steps:
- Select Project ➤ Add New Item.
- In the Add New Item dialog box, select Windows Form, and enter
PickSchedule.cs for the name. - With the PickSchedule.cs form open in design mode, resize it to 450×150
through the properties page. - Add a label, set its Text property to Schedules, add a combo box named
sharedSchedules, and add a button named setSchedule and set its Text