Resolve PPS error below, received when launching Dashboard Designer on a SharePoint 2010 site:
An error occurred during the processing of /sites/sitecollection/BI/Pages/ppssample.aspx. Code blocks are not allowed in this file.
One common solution is to add an exception for the site in question to the web.config:
<PageParserPath VirtualPath="/ /Pages/ppssample.aspx” CompilationMode=”Always” AllowServerSideScript=”true” />
However, I was not very comfortable with modifying the web.config for a single site collection, plus it doesn’t seem to scale very well – what if I have 100 PPS sites with this problem?
So I did a little more searching online and found the following alternative solution: http://oszakiewski.net/eric/performancepoint-error-code-blocks-are-not-allowed-in-this-file .
The solution is to open the ppssample.aspx in SP Designer and modify a function within the code. I had to adjust the syntax a bit – the blog post syntax was not working for my case. See underlined section below.
My site collection URL is …/sites/sitecollection
The PPS site that’s having the problem is …/sites/sitecollection/BI
So my function looks like this:
var designerRedirect = “_layouts/ppswebparts/designerredirect.aspx”;
var siteCollection = “/sites/sitecollection/”;
var siteLocation = “/sites/sitecollection/BI/”;
var siteCollectionUrl = location.protocol + “//” + location.host + siteCollection;
var siteLocationUrl = siteLocation.replace(siteCollection,””);
designerRedirect = siteLocation + designerRedirect + “?SiteCollection=” + siteCollectionUrl + “&SiteLocation=” + siteLocationUrl;
location.href = designerRedirect;
It appears to have worked just as well as the first (more common) solution.