CHAPTER 10 MANAGING REPORTS
searcher.PropertiesToLoad.Add("cn");
searcher.SearchScope = SearchScope.Subtree;
result = searcher.FindOne();
return result.Properties["mail"][0].ToString();
}
To use this, all you have to do is modify the To parameter for the delivery extension in the
ScheduleReport method you wrote earlier to use the new method you just wrote. So, your previous code
for the To parameter becomes this:
extensionParams[0] = new ParameterValue();
extensionParams[0].Name = "TO";
extensionParams[0].Value = GetEmailFromAD();
Now run the SSRS Viewer RVC, and choose a schedule from the shared schedules you previously
configured. For the parameters, enter ServiceYear 2009, ServiceMonth November, BranchID Grid Iron,
and EmployeeTblID McDonald, Sherri; this will create a subscription that is e-mailed to you on the
schedule you selected. If you navigate to the server now using your browser, select the Employee Service
Cost report, and then select the Subscriptions tab, you should see your subscription, as shown in Figure
10-31. If you click Edit, you see that it has provided all the parameters you selected, and it inserted the
desired e-mail address in the To field.
Figure 10-31. Subscription as it appears in SSRS 2012