Opening views and executing tasks from reports

SCOM 2007 reporting infrastructure has an ability to invoke a view or execute a task defined in a Management Pack from a report. This functionally helps bringing context from the report "back" to the operation console. Most of the out-of-the-box SCOM 2007 reports leverage this feature to open various typed of monitoring or in certain cases even authoring views.

Reference to a view or a task is a regular RDL Hyperlink that points to a specially formatted URI. This formatting lets SCOM console to treat it as an execute a view or a task command rather than a report drill-down. There is a ConsoleIntegration class that helps in formatting console links correctly. This class is defined in the SCOM reporting code extension library (Microsoft.EnterpriseManagement.Reporting.Code.dll) that is shipped with the product and installed into Report Server Bin directory during setup. You need to reference this library to make it available for the report code to call.

<CodeModules>
    <CodeModule>Microsoft.EnterpriseManagement.Reporting.Code, Version=6.0.0.0, Culture=neutral</CodeModule>
</CodeModules>

After the library is referenced you can start using it. Here is an example that references State view from a report:

<Textbox Name="textbox">
    ...
        <Action>
            <Hyperlink>= Microsoft.EnterpriseManagement.Reporting.ConsoleIntegration.CreateConsoleViewLink(
                                    Fields!ManagementGroupGuid.Value,
                                    "Microsoft.SystemCenter.StateView",
                                    Fields!ManagedEntityGuid.Value)
            </Hyperlink>
        </Action>
    ...
</Textbox>

ConsoleIntegration class defines a set of overloads for links. Here is the list:

string CreateConsoleViewLink(
  Guid managementGroupId,
  string viewName,
Guid viewTarget)

string CreateConsoleViewLink(
string managementGroupId,
string viewName,
string viewTarget)

string CreateConsoleTaskLink(
Guid managementGroupId,
string taskName,
Guid taskTarget)

string CreateConsoleTaskLink(
string managementGroupId,
string taskName,
string taskTarget)

Since data warehouse can collect data for multiple management groups "managementGroupId" is a required parameter for all calls.

The important thing to remember is that these links make sense only in a context of SCOM console. They will fail to execute in case you try to clink on them in default SQL Report Manager interface. To avoid these failures you need to make sure you declare Interactive parameter in your report. SCOM console always sets this parameter to True when the report is executed in the console.

<ReportParameter Name="Interactive">
    <DataType>Boolean</DataType>
    <Nullable>true</Nullable>
    <DefaultValue>
        <Values>
            <Value> =False</Value>
        </Values>
    </DefaultValue>
    <Prompt>Interactive</Prompt>
    <Hidden>true</Hidden>
</ReportParameter>

The last step is to make sure you use the parameter to hide hyperlinks in the report.

<Visibility>
    <Hidden> =Parameters!Interactive.Value &lt;&gt; True</Hidden>
</Visibility>