Thursday, August 23, 2012

Default SSRS 2012 Parameters Pane to Collapsed in a PerformancePoint Reporting Services Web Part


Using PerformancePoint Reporting Services web parts on a dashboard is a great way to display information alongside Analytic Reports, in ways that aren’t supported by Analytic Reports (e.g. maps or scatter charts) or for data that doesn’t exist in your Analysis Services cubes. Offering visible parameters for your users to manipulate can additionally increase the value and interactivity of a report. However, when displaying a PerformancePoint Reporting Services web part with parameters, the parameters pane defaults to being expanded. Below is an example of a line chart that wouldn’t be easily possible using an Analytic Chart, with the parameters pane obscuring half of it.

Generally this is good (i.e. having the parameters pane defaulting to expanded), but if real estate is an issue (like in the image above), you may want that pane collapsed in its initial state. To work around this issue, we can use the NotifyBrowserOfAsyncUpdate event and some jQuery to locate a PerformancePoint Reporting Services web part and collapse the parameters pane, if it exists. Note, that this event is triggered for every PerformancePoint web part that is updated on a page.

function NotifyBrowserOfAsyncUpdate(elem) {
    // id of web part being updated
    var elemId = $(elem).prop('id');
    // find iframe sources that contain .rdl
    $('#' + elemId).find('iframe[src*="%2Erdl"]').attr('src', function(i, val) {
        return val.replace('&rv:ParamMode=Displayed&','&rv:ParamMode=Collapsed&')
    });
}

Now when your dashboard is displayed, the parameters pane will default to being collapsed, showing your chart, map or tablix in all of its glory.

2 comments:

  1. Forgive a dumb question. Can the code you list above be placed in a Content Editor Web Part on the Performance Point page or is there lots more to it than that?

    ReplyDelete
    Replies
    1. Hi Jim,

      Good question. I am using jQuery to find the iFrame element that is pointing to the web part containing the reference to the RDL, so you'll need that (I reference the jQuery Library in my Master Page). Because I use this code on many dashboards throughout my site collection, I have the code in a separate JavaScript file, however, I placed the reference directly in the page using SharePoint Designer (probably not ideal). The Content Editor Web Part should work equally as well (I would think) and is probably a better method to add a JavaScript reference to an individual page.

      Hope that helps,

      Ken

      Delete