Monday, 1 October 2012

The Excel Workbook Cannot be Opened

This could be because you use a custom Service Account for all your service application / Excel Services then you need to do either one of the following :
  • Add the Excel services Service account to be a Dbowner on your content database that holds the web application
  • Or copy the following script and run it

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0
$webApp = Get-SPWebApplication "VDM_Intranet"

Thursday, 7 June 2012

JQuerry & SharePoint 2010 (Part 2)

Following my Previous post, I decided to put the JQuerry library in my Style Library.
Remember: this is not a one off task, as later on you may need to add more scripts in your scripts library.
The next step will be to add a JQuerry reference to your Master Page.It will allow you to use your JQuerry items in every page which is using that Master Page whithout having to reference to it every time. and remember, you only can have 1 JQuerry reference at a time.

By default SharePoint 2010 uses v4.master as sites default and custom master page.
You probably want to create a copy of V4 and add the JQuerry reference in the custom one. When you created your custom master page, open it in SharePoint designer to be able to edit it. Find the file, Right click on it and select "Edit in advanced mode".

Add "ScriptLink" tag as bellow inside the <Head> tag:
<script src="/Style%20Library/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
Save the master page, check in and publish it.

Now go to your site setting, and change the site master page from V4 to your newly created custom master page. and that's it you can start using JQuerry and add your own custom codes. have fun.

In the next post, we are going to add some cool features to this newly build SharePoint site.

Tuesday, 8 May 2012

JQuery & SharePoint 2010

As  the way I'm experiencing SharePoint through Internet resources, sometimes it takes me a while until I found the right steps to do something.
For using JQuery in SP2010, there are heaps of good resources out there. but I had to mix several of them, to understand what exactly I should do to be able to start using it in my environment.
Here is a summary of what I learned:

What is JQuery?
they say "JQuery is a new kind of JavaScript Library"
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

Install/Add it to SharePoint:
As far as I understand, there is no need for any type of installation. But to be able to use the JQuery in your code, you need to have a reference to where the JQuery library is.
I already found three ways to access to this library, and I leave it to your choice, which one is the best. there are lots of debates out there, so you may search it for yourself.

Please do remember, at the time of this post the latest version is 1.7.2
You can find the latest version from

1. CDN Hosted JQuery. (reference to an on-line place, where the library is hosted.)
A number of large enterprises provide hosted copies of jQuery on existing CDN networks that are available for public use. Below are links to the CDN-hosted copies of jQuery that you may hotlink to. 

2. 14 Hive folder
If you have access to the SharePoint server, you can save the "Minified version" or the "Full version" in this address and then link to it from your code.
14 hive\TEMPLATE\LAYOUTS\_CustomJScripts 
(if you don't know how to go to 14 Hive, it may be better idea not to do any change on your server and use the library method. by the way, it is here: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14)
3. SharePoint Library
Just create a resources library in your root site and upload your JQuery files there.

As it seems, the method of using SharePoint library is the simplest of three. for 14 Hive, you need to have access to your server and if you use CDN, well it is an online resource so it means your site or better say, your codes are only working when you have Internet access. what if Internet is temporary down but you need your Intranet to stay live, or what if one of those big guys who'se hosted the library (like google or microsoft) decides to do not support JQuery anymore. Are you willing to go through all of your codes and change the references everywhere.

Just saying, think about it and decide wisely depend on your situation.

I will continue these post, along with my own tests and will keep you posted anything I find on the way.