Add a Version Parameter to the ScriptSrc URL in a ScriptLink CustomAction

The CustomAction element provides a great way to inject a JavaScript file into every page in a site collection or site without having to explicitly reference the file in a master page. You simply set Location to “ScriptLink”, specify the path to the JavaScript file in the ScriptSrc attribute and it will generate a script tag. This is particularly handy in situations where you may need script to execute in pages that don’t use your master page like the PerformancePoint application pages that open in a new window.

Reload in Netscape

“You need to click the Reload button. And upgrade your browser.”

One problem you can run into with any JavaScript external script include is that users may be seeing stale versions of a script file. Whenever you update a script, you may find that need to have your users explicitly refresh the page to get the latest changes to the file. If they don’t refresh, they will likely be getting a locally-cached version of the file.

If you use a ScriptLink control to add script tags to your page, it takes care of this problem for you. The ScriptLink control will automatically append a “rev” query string parameter to the URL of the referenced script file that contains a version ID for that file so when the script is updated on the server, the new query string parameter forces the browser to request the latest version of the file. The browser can then continue to serve this file from cache until the version on the server is updated again.
Read more of this post


Hide PerformancePoint “Show Details” Menu Item

One big issue we’ve found with the Show Details menu item in scorecards and analytic reports is that if you use it on a calculated measure, it’ll pop up a window with the error message, “Error Running Data Source Query. Contact the Adminstrator for Details.” If you look in the Application event log, you’ll find more information in a Warning event with the error message below.

Error running data source query.
You cannot drillthrough if the cell in a select clause is a calculated cell.

    You cannot drillthrough if the cell in a select clause is a calculated cell.

This is a limitation of SQL Server Analysis Services and drillthrough on a calculated cell is still not offered, at least not as of SQL Server 2008 R2.

For our dashboards we really didn’t need the Show Details option at all, so I wanted to find a way to get rid of that menu option entirely. Read more of this post

Wait, There’s No Code-Behind File for a SharePoint Master Page?

How Hard Can It Be?I recently had a situation where our SharePoint 2010 site’s master page was emitting an empty DIV element that ruined the layout of several pages in the site. Although largely extraneous on most pages, the DIV and it’s child ContentPlaceholder control was required by a handful of pages on the site, so we couldn’t just delete it.

As an ASP.NET developer still relatively new to SharePoint, I thought that a simple fix would be to add code to the master page to suppress the errant DIV on pages where the placeholder wasn’t used. How hard can it be?
Read more of this post

Saving a PerformancePoint Analytic Report from a Web Part Menu

Having worked with PerformancePoint for a few months, I have to say it has it’s quirks. Coming as I do from a web development background, it’s been very frustrating to find myself in situation after situation where my ability to affect how it works is limited. The Show Details option, for example, breaks ugly if you attempt to use it on a calculated measure in an analytic chart or grid and I’ve been unable to find a built-in way to get rid of it entirely.

I thought I was in the same boat when our users wanted a way to save the current state of an analytic report or grid in its current navigated state, but it turns out that there is a solution. The Microsoft Office Developer Documentation Team has released a bit of code, PerformancePoint Services 2010: Save Analytic Report Sample, that serves as an excellent starting point. Indeed, I suspect that for many clients it’s probably good enough out of the box.

For our purposes however, the sample implementation was not entirely appropriate for several reasons.

  • First, if the user clicked the Page tab on the ribbon before any of the reports had been rendered on the page, the save button would be disabled.
  • If you want to display a dashboard to users with limited privileges in your site, the ribbon is not displayed.
  • The ribbon is also unavailable on analytic reports that have been opened in a new window.

For these reasons, we decided to add a “Save Report” item to the web part menu where the user would already find the commonly-used options such as “Export to Excel” or “Open in a New Window.”

Save Report option on Web Part Menu
Read more of this post