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

Bulk Calculation of Quartile and Median Values in SQL Server

Previously, I posted about calculating median and quartiles in Analysis Services. In this post, I’ll do the same calculations over multiple sets of rows in a SQL Server database.

SQL Server offers an NTILE() function, but this is not equivalent to the Quartile() function in Excel which is the functionality we are trying to replicate. NTILE() is a window function that essentially returns a value representing the group into which each record would fall if you are trying to rank records. What we want is an aggregation function that will return a single value (25th percentile, 50th percentile or median, or 75th percentile) for each group of records.

The code below is an example of how this can be done in a single SQL statement.
Read more of this post

Goodbye, Lotus Notes

Notes logo tombstoneToday is my last day as a Lotus Notes user. Assuming all goes well, I’ll be accessing my work email and calendar using Outlook starting tomorrow.

For the most part, I’m not sad to see Notes go, but I have to say that I thought it was an intriguing product when I first saw it in the 1990’s. At that time, I was working for a firm that provided outsourced technical support for off-the-shelf software products and I somehow assumed responsibility for Notes end-user and developer support.

As many proponents are quick to point out, Notes is an application development platform and a document-centric database, not just an email program. It provides a forms tool for viewing and editing documents, a view system for displaying and sorting lists of documents, and an access control security system.

Read more of this post

Yipes! Stripes! (Color-coded Rows in Excel)

Fruit Stripe Gum adI occasionally receive spreadsheets where rows of data are colored yellow, teal or pink to indicate some special status. Essentially, the fill color feature is used like a highlighter marker, something the paint bucket icon on the toolbar or ribbon makes easy to do. In and of itself, there’s nothing wrong with highlighting rows, but problems can arise if color-coded rows are the only way that some important piece of information is communicated.

Read more of this post