Showing posts with label Performance point 2010. Show all posts
Showing posts with label Performance point 2010. Show all posts

Thursday, October 18, 2012

Code Blocks are not allowed in this file - Performance Point part 2

As discussed in the previous post how we can fix the Code block error for performance Point, now lets find the reason why the error occurs on the PPSample.aspx and how we can eliminate it at the time of writing the Feature for Masterpage.

The main reason for this error is the the page is updated with the property "customized" this can be checked by the file property "CustomizedPageStatus" in the document library.


following is the code to check if the file is customized/unghosted.

void WriteCustomizedAndNone(object sender, EventArgs e)
        {
            string myResult = '';
            string myListName = txt1.Text;
            SPList myList = SPContext.Current.Web.Site.RootWeb.Lists[myListName];
            if (!Directory.Exists('C:\\Unghosted Files\\'))
            {
                Directory.CreateDirectory('C:\\Unghosted Files\\');
            }
            myResult += 'Status of items<br><br>';
            myResult += '<table style='border:solid 1px gray;'>';
            myResult += '<tr>' + '<td>' + 'Name' + '</td>' + '<td>' + 'Setup Path' + '</td>' + '<td>' + 'is customized' + '</td>' + '</tr>';
            foreach (SPListItem anItem in myList.Items)
            {
                myResult += '<tr>' + '<td >' + anItem.Name + '</td>' + '<td >' + anItem.File.Properties['vti_setuppath'] + '</td>'  + '<td>' + anItem.File.CustomizedPageStatus + '</td>' + '</tr>';
                if (anItem.File.CustomizedPageStatus.ToString() != 'Uncustomized')
                {
                    byte[] myBytes = anItem.File.OpenBinary();
                    System.IO.File.WriteAllBytes('c:\\Unghosted Files\\' + anItem.File.Name, myBytes);
                }
            }
            myResult += '</table>';
            result.Text = myResult;
        }/*Thanks to my friend Siva for this code*/


Note: The page gets updated with the property with Customized if there is any update happens on the page after/during the feature activation, make sure there is no changes happening during the feature activation. 

Any change in the master page will result in UnGhosting which will update the file property to "Customized" and will result in the issue with Performance point "Code Blocks are not allowed in this file".




Wednesday, October 3, 2012

Code Blocks are not allowed in this file - Performance Point



After the customization of the master page in SharePoint 2010, we sometimes get the following error
"Code Blocks are not allowed in this file"

There are two solution for this
1. Add the Page Parser Path in web.config
<PageParserPaths>
       <PageParserPath VirtualPath="/BICenter/Pages/ppssample.aspx" CompilationMode="Always" AllowServerSideScript="true" />
     </PageParserPaths>

2. Modify the PerformancePoint site template by updating the /BICenter/Pages/ppssample.aspx

Replace the following
var siteCollection = "<%=SPHttpUtility.UrlPathEncode(siteCol.Value,false,true)%>";
var siteLocation = "<%=SPHttpUtility.UrlPathEncode(site.Value,false,true)%>";

with
var siteCollection = "/";
var siteLocation = "/BICenter/";

Tuesday, October 4, 2011

Cannot complete this action as the Secure Store Shared Service is not responding. Please contact your administrator.

While configuring the performance point 2010 I got the following issue
Cannot complete this action as the Secure Store Shared Service is not responding. Please contact your administrator.

After trying many approaches, I found the solution
1. Make sure the SecurityTokenServiceApplicationPool is running.
2. Go to System Settings -> Manage services on server
Following services should be enabled
PerformancePoint Service
Secure Store Service
Claims to Windows Token Service
3. Go to Application Management -> Manage service applications
4. Check the Secure Store is started
5. Go to App-pool and make sure the the associated App pool is running
6. Reset the IIS