Pro SQL Server 2012 Reporting Services

(sharon) #1

CHAPTER 10  MANAGING REPORTS


You haven’t seen all the possible options that you can use when scheduling reports such as the
Employee Service Cost report, but we’ve given you a good start to schedule and deliver reports and add
other functionality. Some possibilities include the following:


  • Allowing the user to decide the format the report will be delivered in

  • Allowing the user to attach the report or just provide a link

  • Allowing the user to create schedules on the fly


You can use the SSRS 2012 Report Server Web service to control many more aspects of the report
server and the reports under its control. We have just scratched the surface here of what you can do, but
be aware that the basic aspects of dealing with the report server through the Report Server Web service
are the same for nearly all the functions.

Controlling SSRS with WMI


Before we finish this chapter, we should also briefly discuss how you can manage SSRS using two WMI
classes. These classes are used more for administrative tasks and allow you to access server settings
programmatically. WMI is not used for manipulating reports or report settings.
WMI offers a standardized way to monitor and control systems and services running anywhere on
your network. Using the WMI provider, you can write code that allows you to query the current settings
of an SSRS 2012 server and also to change those settings through properties and methods of the classes
providing these services.
Essentially, these providers allow you to change the settings of the configuration files on the server
programmatically. So, as you might guess, the properties of these classes correspond almost directly to
the elements within the XML files that hold SSRS 2012 configuration information.
Table 10-2 shows the two classes provided by SSRS 2012 for use with WMI.

Table 10-2. SSRS 2012 Classes for Use with WMI

Class Controls Configuration File

MSReportServer_ConfigurationSetting Re port Server RSReportServer.config

MSReportServerReportManager_ConfigurationSetting Report Manager RSWebApplication.config

You can use the MSReportServer_ConfigurationSetting class to determine and/or configure most of
the database settings used by SSRS 2012 itself—that is, for the database that SSRS uses to store the
reports, snapshots, and so on. This class doesn’t control the data source connection information used in
your reports, although you can set the login information that the server uses to run a report in
unattended mode. You can also work with things such as the database server name, database name, and
login credential information in this class. You can also use this class to configure the SSRS 2012 service
instance name, path name, and virtual directory it maps to in the integrated HTTP system.
You can use the MSReportServerReportManager_ConfigurationSetting class to determine the
instance name, path name, and virtual root of the SSRS 2012 Report Manager, as well as to read or set
the URL of a particular instance.
To access this information through the SSRS 2012 WMI providers, you use the System.Management
namespace, which provides access to WMI.
Free download pdf