CHAPTER 10 MANAGING REPORTS
pickSchedule, and set its Text property to Schedule. This will allow the user to pick a schedule from the
viewer.
Figure 10-30. Adding Schedule button to the ViewerRVC.cs form
Second, after you add the button to the form, add the code shown in Listing 10-9 to the button’s
click event by double-clicking the Schedule button with the ViewerRVC.cs in design mode. Of course,
you need to use the name of your report server where you see localhost in the URL.
Listing 10-9. The pickSchedule Button’s click Event
private void pickSchedule_Click(object sender, EventArgs e)
{
reportURL.Text = "http://localhost/reportserver?/Pro_SSRS/Chapter_7/EmployeeServiceCost";
PickSchedule reportSchedule = new PickSchedule(reportURL.Text);
reportSchedule.ShowDialog();
}
At this point, you can run the program; however, before you can schedule the report, you must set
the credentials for the shared data source so the report will have login credentials to use when it is not
run interactively. If you are using SQL authentication, you can do this by opening the Reports project in
the solution and double-clicking the Pro_SSRS.rds data source. On the Shared Data Source dialog box,
select the Credentials tab, and select Use a Specific User Name and Password. Enter the appropriate
username and password to use when running this report. If you are using Windows integrated
authentication, such as running reports under your Windows account, you need to use Report Manager
or SSMS to edit the data source and select the Use As Windows credentials when connecting to the data
source option. For Windows accounts, specify the login name using the format domain\user.
Now run the program, and pick one of your previously configured schedules. For the parameters,
enter ServiceYear 2009 and select OK to set the schedule for this report.
Note Remember to use SSMS or Report Manager to set up your shared schedules. You must be logged in as a
user who is a member of the SSRS 2012 System Administrators role to add new schedules. See the section titled
“Creating a Shared Schedule” earlier in this chapter for details.