Code Samples

The following additional resources are available in the Code Samples folder.

Report Project Template

The report project template contains a sample Visual Studio .NET report project that contains three reports. This is a useful starting point for authoring a new report project.

The following changes are needed, in order to use the report project template supplied:

  • Change the target folder name to the folder name you want. To do so, edit the folder name by right-clicking on the project name and choosing Properties.

In addition, the following changes need to be made to the project if the server, on which reports are being authored, is not the same as the server on which the MOM reporting database and/or SQL Server Reporting Services are installed:

  • Modify the data source to reflect the correct location of the MOM reporting database. This can be done by editing the data source properties by double-clicking the data source titled SCDW, to bring up the Data Source Properties dialog. Choose the Edit button on the General tab to modify the data source location.

  • Modify the report server URL by editing the project properties: Right-click on the project name and choose Properties to view the project properties dialog. The TargetServerURL property in this dialog needs to be modified to reflect the correct location of the report server.

Sample SQL Queries

The following sample SQL queries are included. These queries are not suitable for including in a report unless they are restricted to a subset of the returned data:

  • AllPerformanceData.sql: selects all performance data that is stored in the MOM reporting database.

  • ComputersAndRuleGroups.sql: displays a single row for each set of computers, associated computer group and associated rule group. It can be modified to list the computers associated with a computer group, the rule groups associated with a computer, or the rule groups associated with a computer group.

  • SelectAllAlerts.sql: returns a single row for each alert, including all of the relevant properties related to the alert.

  • SelectAllEvents.sql: returns a single row for each event, including all the relevant properties related to the event.