PerformancePoint error: “Code blocks are not allowed in this file.”
While creating a new BI Center at my company we had no trouble building the site in dev, creating dashboards, Excel reports, etc. Everything worked fine. We were rolling the solution out to production (keeping in mind, our dev and prod installations of SharePoint 2010 were created identically), but when we clicked on “Start Using PerformancePoint Services”, we were met with the error page and the message
“An error occurred during the processing of /<BI Center>/Pages/ppssample.aspx. Code blocks are not allowed in this file.”
I started researching what could cause this, and saw numerous posts talking about modifying web.config. Tried them all and got nowhere. On top of that, I have a real hard time with just modifying web.config on a production system to fix a problem on a single site. Fortunately, thanks to the @Statera contractors assisting us with the installation, we came across this TechNet article explaining how to fix this that made a LOT more sense.
Basically, you need to open the affected BI site in SharePoint Designer. Click All Files under Navigation on the left, then in the pane to the right open the Pages folder and click on ppssample.aspx to open it. When prompted to check out the file, check it out. Locate the JavaScript function near the top called OpenDD() and edit the following two lines:
var siteCollection = "<%=SPHttpUtility.UrlPathEncode(siteCol.Value,false,true)%>";
var siteLocation = "<%=SPHttpUtility.UrlPathEncode(site.Value,false,true)%>";
And change them to this:
var siteCollection = "/";
var siteLocation = "/<path to BI Center parent site>/<BI Center site name>/";
So if your bi center is located at http://server/sites/site/bicenter, var siteLocation should look like this:
var siteLocation = "/site/bicenter/";
Save the file and publish a Major version. You should now be able to click on “Start Using PerformancePoint Services” and run Dashboard Designer.
Hope this helps!
27 thoughts on “PerformancePoint error: “Code blocks are not allowed in this file.””
I just get a blank screen after doing all of these suggestions??
Oooops ,!!! it worked for all but im still getting same error !! why ????
Make sure the URL for var sitecollection looks just like “/site/bicenter/”, no http or https, leave the ending “/”. Also make sure it’s not just saved, but a Major version is published, and it’s not checked out. If it’s still throwing an error what error are you getting? Also check the ULS to see if there’s more information as to what’s going on when the error occurs. Feel free to post the error here.
Thanks a lot – worked like a charm
Thank you! Worked perfectly for me!
I was able to navigate to the page, but it doesn’t let me edit the file.
Are you a Site Collection Admin or Farm Admin at your location? If not you’ll either need to have someone elevate your permissions or have one of the Farm Admins perform the change. That would be my first guess.
I got it working, I wasn’t editing in Advanced mode.
I spoke a little too soon. I did manage to edit the file and it displays the Business Intelligence launch screen, but when I click on Run Dashboard designer, I get a “file not found” error. When I look at the url it reads:
http://overallsitecollection/teamsite/bisite
but it should read this:
https://overallsitecollection/sitecollection/teamsite/bisite
I’ve been playing around with the syntax of the ppsample file, but not successful yet. Any thoughts?
I’m wondering if you need to change your ppssample.aspx code to look like this:
var siteCollection = “http://overallsitecollection/sitecollection”;
var siteLocation = “/teamsite/bisite/”;
Maybe because your structure has a parent and child site collection, it needs to be broken down this way?
I got it. Finicky little thing.
absolutely perfect. thanks sooo much!
Very Nice. I like this option much better than modifying the web.config to allow server side code if you do not need it.
BAM!!!! Turns out I don’t need server admin privileges. Not sure why it wouldn’t let me edit the page before, but I tried again and it did, and this worked like a charm. Great info, thanks for putting this out there.
Still would be interested to hear about any thoughts with respect to my question, but, hardly a priority.
Thanks again, really, REALLY helpful.
And one final “disregard”…I read the TechNet article, and saw this:
Summary: When site administrators modify the PerformancePoint site template, it affects the underlying master page in SharePoint Server 2010 and enables server-side scripting.
So, obviously, our site admins must have needed to modify the template. So, in the end, I learned not just how to fix the problem, but a little bit more about SharePoint. Which makes this good stuff all around 🙂
So here’s a bummer…I don’t have server admin privileges. Site admin, yes, but not server – so I can’t edit the .aspx or master pages.
Which forces me to raise the question – why wouldn’t Microsoft code BI sites so that they figure out what those parameter values need to be, based on the parent site path, or modify the “variable” values in each of the parameters so that Performance Point services worked right out of the box? This really seems like you have to go in and fix something that is broken when it ships.
Thanks so much! Great step by step instructions.
Thanks Eric – it worked for me!
It is really coooooooooooooooooooooooooooooooooooooooooooool
This works like a charm. After looking in to this issue, I almost given up as all suggested to modify either master css file of web.config file. Both option not available for me.
Than I found this article. Thanks you so so so much…
Incredible. Our client blocks us from server-side access so this was a god-send. Cheers to you!
Hm. Do you know why I would receive a http 400 bad request error after clicking on the button to run dashboard designer?
Take a look at your ULS logs while trying to run Dashboard Designer. It might have something to do with the construction of the site location variable in the ppssample file? I know the last “/” has to be there because of the way it dynamically creates the URL while loading Dashboard Designer…
We also ran into file not found errors in our environment. The fix is in how the siteCollection and siteLocation variables are set. In our case, we were in a web app using managed paths. To make this work for a BI Center in the root site collection of the web app, we used:
var siteCollection = “/”;
var siteLocation = “/bicenter/”;
To make this work for a BI Center that wasn’t in the root site collection we used:
var siteCollection = “/sites/foo/”;
var siteLocation = “/sites/foo/bicenter/”;
where sites is our managed path, foo is our non-root site collection, and bicenter is a subsite of foo.
All of that worked without needing to modify the web configs.
Yes this worked Thanks!
Excellent article man !!
Comments are closed.