Archive for category SharePoint 2010

Content Editor Web Part (CEWP) & JavaScript duplicating entries in SharePoint 2010

Recently we have migrated our SharePoint 2007 application to SharePoint 2010 and we also had manually configured few web parts in the new environment. Most of the web parts were working perfectly like sharepoint 2007 but one content editor web part which shows the weather forecast had some wired repeating behavior! 😦

Here is the weather forecast web part in the 2007 which has JavaScript to update the weather from their web site.

The JavaScript code in the Source editor:

I have created the CEWP in 2010 and paste the source code in to the editor.

and Publish the page, It is working fine no? but not really..!

Whenever I edit the page, the web part is duplicating the weather widget like this!

After spending few minutes I have found the solution in this post, actually SharePoint 2010 does not support the JavaScript directly into the source editor. So we cannot copy and paste the JavaScript to the CEWP editor instead, we have to create the scripts as a txt file (paste into a Notepad and save), upload into the SharePoint and then pointing that file as the source of CEWP.

Step 1: Open a Notepad and paste the source code

Step 2: Upload the txt file into SharePoint

Step 3: Get the url path of the txt file and paste it on the content link property of the content editor pane on the right side and click ok.

That’s all. No duplication probs any more. Happy Migrating..!

Thanks. R./

References:

1. http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/

, , , , , , ,

3 Comments

Turn on detailed error messages in SharePoint 2007 /2010

This is not really new but currently I am working on some customized web parts, so I need to turn on/off the detailed error messages when I need to fix some hectic problems on my development environment. There are many posts regarding this, but I wanted to keep my own post for my future references. 😉

Normally SharePoint shows custom error messages to the users such as “An unexpected error has occurred” but this is not going to help, so we need to know the detailed ASP.NET error message to fix the problem. Here are the steps to turn off custom error messages.

Step 1: Go to the SharePoint host server and navigate to the Virtual Directories folder. Normally this is available in this path “C:\Inetpub\wwwroot\wss\VirtualDirectories”

Step 2: Find the web.config and get the backup for the safety purpose

Step 3: Open the web.config file using Visual Studio OR Notepad

Step 4: Find the “CallStack” and change the value to “true” instead of “false”

Step 5: Find the “CustomErrors” and change the value to “Off” instead of “On”

Step 6: Save and close the web.config, refresh the page then you will get the detailed (wired) error message. Time to fix this huh? 🙂

Error message before turning on:

Error message after turning on:

MSDN reference shows the “CustomErrors” values can be one of these:

Value Description
On Specifies that custom errors are enabled. The custom errors are shown to the remote clients and to the local host.
Off Specifies that custom errors are disabled. The detailed ASP.NET errors are shown to the remote clients and to the local host.
RemoteOnly Specifies that custom errors are shown only to the remote clients, and that ASP.NET errors are shown to the local host.

If you want, you can also set the “CustomErrors” value to “RemoteOnly” to show custom errors only to the remote clients.

R./

References:

1. http://davidkvas.blogspot.com/2011/05/turning-on-detailed-error-messages-in.html

2. http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx

, , , , , , , ,

1 Comment

You do not have permissions to open this file on Excel Services OR Excel cannot load the workbook that you requested –SharePoint 2007

One of my colleagues sent an error message while using the development site of SharePoint 2007 in my office and I figured out the configuration of “Excel Calculation Services” was not done properly. It’s a very simple set-up, here we go:

1. Make sure that “Excel Services” (Actually “Excel Calculation Services”) is running. To check this out please do the following steps:

Central Administration –> Operations under “Topology and Services” click “Services on server” 

On the table below we can see the “Excel Calculation Services” is started. So it’s running 🙂

2. Make sure that, file access method of “Excel Services Settings” is using “Process Account”, instead of the Impersonation. To do this, follow these steps:

Go to Central Administration –> Home

On the left menu, under “Shared Services Administration” Select your “Shared Services” (for me SharedServices2 but default SharedServices1)

Under “Excel Services Settings” click the “Edit Excel Services Settings” 

Change the file access method to “Process Account”.

3. Finally make the following changes on the Trusted file locations under “Excel Services Settings”. Here are the steps:

Go to the “Shared Services” underExcel Services Settings” click the ”Trusted file locations”.

You will be navigating to the Excel Services Trusted File Locations page. Then click “Add Trusted File Location”.

In the Location pane, do the following:

– Address: In this field we can enter a Document library or full portal Url (I have given Document library path). Please note: Don’t use like http://server:1010/documentlibrary1/forms/default.aspx instead of http://server:1010/documentlibrary1

– Location Type: For this field we have to select the “Windows SharePoint Services” option

– Trust Children: Ensure whether we need to be trusted the child libraries or directories, here I selected “Children Trusted”

Then click OK, that’s all! It is working huh! 🙂

References:

1. http://www.eggheadcafe.com/community/sharepoint/69/10068914/you-do-not-have-permissions-to-open-this-file-on-excel-services.aspx

2. http://blogs.msdn.com/b/andreww/archive/2009/04/21/excel-services-setup-and-getting-started.aspx

, , , , , , , , ,

3 Comments