Report parameters block


It is not a secret that standard way of presenting report parameters in SQL Server Reporting Services does not give you much flexibility. Designing reporting solution for SCOM 2007 we wanted to change that and enable a way reach controls could be used for report parameter selection. Imagine yourself scrolling though a list of all computers in your organization trying to pick a particular one. We didn’t want that to happen…


As you know report parameters are traditionally defined in the RDL file. The RDL file parameter definition contains name, type, list of valid values, default value etc. It also contains parameter presentation attributes like display name and hidden flag. Standard SSRS parameter block layout logic is very simple: visible parameters are rendered in two columns (from left to right then from top to bottom) based on the order of parameters in the RDL file.


In SCOM 2007 we introduced report parameter definition block which provides additional layout and parameter presentation logic. The parameter block definition is stored in the RPDL (Report Parameter Definition Language) file. This file has to be stored in the same folder with the repot and have report name with “.rpdl” extension.


RPDL file is optional. SCOM 2007 will render parameters similarly to standard SSRS parameter block if you do not specify one.


What is inside RPDL file? Let’s take a look. Here is an example:


<ParameterBlock
   
columns=3
    xmlns=http://schemas.microsoft.com/mom/reporting/2007/
           ReportParameterSettings
>

  <Controls>
    <
Control rowSpan=2 columnSpan=2
        type=Microsoft.SystemCenter.DataWarehouse.Report.
              ParameterControl.MonitoringObjectXmlPicker
>

      <
ReportParameters>
        <
ReportParameter name=ObjectList />
        <ReportParameter name=ManagementGroupId
                        
binding=GroupList />

      </ReportParameters>
   
</
Control>
   
<
Control
        type=Microsoft.SystemCenter.DataWarehouse.Report.
              ParameterControl.ComboBox
>
      <ReportParameters>
        <ReportParameter name=Threshold />
      </ReportParameters>
    </Control>
   
<
Control
       
type=Microsoft.SystemCenter.DataWarehouse.Report.
              ParameterControl.ComboBox
>

      <ReportParameters>
        <ReportParameter name=AggregationType />
      </ReportParameters>
   
</
Control>
  </Controls>
</
ParameterBlock>


As you can see the parameter block XML has a list of parameter controls. This is similar to parameters definition in RDL file. The difference however is that RDL defines parameters while RPDL defines controls to edit the parameter values. Control can manage or use one or more parameters in the underlying report. Controls are defined in a management pack and can have different implementation depending on what platform they are running.


RPDL still uses left to right / top to bottom layout model but you can control how many columns you have and  define if you like controls to span several rows or columns to achieve desired parameters layout.

Comments (5)

  1. Eugene Bykov says:

    Nearly any report requires you to fill some parameters before you run it. Most commonly you are asked

  2. Eugene Bykov says:

    Generic performance reports are ones of the most powerful generic reports in SCOM 2007. I like to start

  3. Chris P says:

    How would I use the ParameterBlock with lets say a RelativeDateTimePicker and a custom value dropdown that I have showing up in ssrs but now with the parameterblock defined, it does not show me the dropdown because the RelativeDateTimePicker takes up the parameter section when I try to run the report in SCOM console. I actually need 2 dropdowns (1 single value selection and 1 multivalue) and also a text box that passes the text to the report.

  4. You would need to add parameters control references for these parameters in RPDL file in a similar way generic reports do. You can look up examples of this in generic report library reports that use drop down controls along with relative date time picker.

  5. Chris P says:

    Thanks Eugene! I got it now. Cheers!