How to total a column of values in a Sharepoint DVWP
By peter.stilgoe
To total a column of values in a Sharepoint DVWP use:
<xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@TotalHoursWorked)" />
To do something similar in Xpath with formatting:
format-number(sum(/dsQueryResponse/Rows/Row/@TotalHoursWorked), '#,##0.00;-#,##0.00')
How to create a back button in Sharepoint
By peter.stilgoe
How to create a back button in Sharepoint to take you back to the previous page either using a text link or image -
Text link:
<a href="#" onClick="history.go(-1)">Back Link Text</a>
Using a back button image:
<a href="#" onClick="history.go(-1)"><img src="linktobackbuttonimage.gif" alt="Back"/></a>
Note: I have only tested this in Internet Explorer
How to display a URL hyperlink in a CQWP
By peter.stilgoe
In the relevant template section in itemstyle.xsl add a line something like (replacing the column name with the your column containing the URL):
LiveView: <a href="{substring-before(@Live_x005F_x0020_View, ',')}">Click here</a>
K2 – The base type ’SourceCode.SharePoint.ProcessPortal.UI.PortalWebPartPage’ is not allowed for this page. The type is not registered as safe.
By peter.stilgoe
When creating a a process portal or trying to access certain sections of a process portal in K2 Blackpearl or Blackpoint & you get the following error:
“Parser Error Message: The base type ’SourceCode.SharePoint.ProcessPortal.UI.PortalWebPartPage’ is not allowed for this page. The type is not registered as safe.
Source Error:
Assembly Name=”SourceCode.SharePoint.ProcessPortal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d
Page Language=”C#” MasterPageFile=”~masterurl/default.master” Inherits=”SourceCode.SharePoint.ProcessPortal.UI.PortalWebPartPage
Register TagPrefix=”SharePoint” Namespace=”Microsoft.SharePoint.WebControls
/k2/default.aspx Line: 3
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927″
Check your web.config & if the below lines dont exist add them & your problem should be fixed:
<SafeControl Assembly="SourceCode.SharePoint.ProcessPortal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d" Namespace="SourceCode.SharePoint.ProcessPortal.UI" TypeName="*" Safe="True" SafeAgainstScript="True" /> <SafeControl Assembly="SourceCode.SharePoint.ProcessPortal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d" Namespace="SourceCode.SharePoint.ApplicationPages" TypeName="*" Safe="True" SafeAgainstScript="True" />
How to add Custom Style Sheet CSS to your masterpage file
By peter.stilgoe
Edit your masterpage file, In the
tag add a link to your custom CSS file just above the content place holder named “PlaceHolderAdditonalPageHead” ie.<link href="/Style%20Library/mystyle.css" rel="stylesheet" type="text/css" />
Sharepoint: How to find a Sharepoint feature by GUID
By peter.stilgoe
If you need to find a Sharepoint feature by its GUID because you are getting the error:
Error: The site template requires that the feature *GUID* be activated in the site collection
1) Site Actions -> Site Settings -> Site Collection Features
2) Right click on the features page and select ‘View Source’
3) Now do a search/find for the GUID & you will find the one in question (if its still installed on the farm)
Sharepoint: Site collection administrators lose their permissions
By peter.stilgoe
Sharepoint Site collection administrators lose their permissions.
An odd problem where I would login to Sharepoint with my normal Sharepoint Site Collection Administrator account & I would only have basic permissons & various OK buttons were greyed out.
This seems to be caused by having multiple jobs running against your Sharepoint databases at the same time, Sharepoint puts the site collection/database into Read Only mode.
To unlock the Sharepoint site / site collection either use Central Admin:
http://SharepointServer/_admin/sitequota.aspx
or use Stsadm:
stsadm -o -setsitelock -url http://servername/sitename/ -lock None
Sharepoint 2010 Powershell Backup Scripts
By peter.stilgoe
Sharepoint 2010 Powershell Backup Scripts
Backup a Sharepoint 2010 Farm:
Backup-SPFarm -BackupMethod Full -Directory "Destination directory" -BackupThreads 5
List all items included the Sharepoint 2010 Farm backup:
Backup-SPFarm –ShowTree
Backup a Sharepoint 2010 Site Collection:
Backup-SPSite -Identity "http://MySharepointServer/SC1/" -Path "Path and Filename"
Forefront Security for SharePoint: Calling LoadLibraryEx on ISAPI filter D:\Program Files\Microsoft Forefront Protection for SharePoint\FSSPUsernameFilter.dll failed
By peter.stilgoe
When Microsoft Forefront Security for SharePoint is installed on a SharePoint server, non-SharePoint sites may have problems accessing the Internet Server API (ISAPI) filter that is installed by Forefront Security.
On Internet Information Services (IIS) 7, users who browse to these sites may receive the following error message:
HTTP Error 500.0 – Internal Server Error
Calling LoadLibraryEx on ISAPI filter “D:\Program Files\Microsoft Forefront Protection for SharePoint\FSSPUsernameFilter.dll” failed
On IIS 6, users who browse to non-SharePoint sites may receive the following error message:
Service Unavailable
Internet Information Services 7 (IIS 7)
- In IIS Manager, navigate to a non-SharePoint Web site that is experiencing this issue.
- Select the Web site, and then double-click ISAPI filters.
- In the Filter pane, select FSSP Username Filter.
- In the Actions pane, click Remove.
- In the confirmation dialog box, click Yes.
Test the site to determine whether the issue is resolved. If the issue is not resolved, an IIS restart of the Web site may be necessary. You can do this through the IIS administrator.
Internet Information Services 6 (IIS 6)
To determine whether issue that is described in this article is the same issue that you are experiencing, examine in the Application Event Viewer. If if the ISAPI filter is causing this issue, the following error will be logged:
Type: Error
Event ID: 2214
The HTTP Filter DLL C:\\Program Files\Microsoft Forefront Protection for SharePoint\FSSPUsernameFilter.dll failed to load. The data is the error.
On IIS 6 servers, the ISAPI filter is not exposed at the individual site level. To resolve the issue, add the account that the non-SharePoint site is running as to the ISS_WPG and WSS_WPG security groups. On these servers, look up the account that the non-SharePoint site is running as. You can do this by looking at the credentials on the application pool that the site is running under. After you have the account that the non-SharePoint site is running as, follow these steps to resolve the problem:
- Add the account that the non-SharePoint site is running as to the ISS_WPG and WSS_WPG security groups.
- This makes sure that the Web site has permissions to load the ISAPI filter in the Forefront for SharePoint directory.
- For the changes to take effect, you must run an IISReset. To do this, open a command prompt, and then type IISReset. This shuts down and restarts all IIS services.
Sharepoint CQWP: XSL template to display document details
By peter.stilgoe
An example XSL template to display document details in a content query webpart:
<xsl:template name="DocumentsDetails" match="Row[@Style='DocumentsDetails']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="''"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
<xsl:with-param name="UseFileName" select="1"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayAuthor">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="''"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
<xsl:with-param name="UseFileName" select="1"/>
</xsl:call-template>
</xsl:variable>
<div class="item link-item">
<xsl:if test="string-length(@DocumentIconImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<img class="image" src="{@DocumentIconImageUrl}" title="" />
</a>
</div>
</xsl:if>
<div class="link-item">
<div style="color: black; font-family: Arial, Helvetica, sans-serif; line-height: -2%">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$DisplayTitle"/>
</a> | <xsl:value-of select="@Author" /> | <xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDate(string(@Description), 2057, 5)" />
</div>
</div>
</div>
</xsl:template>
A returned file in the CQWP will display:
Plan 36 | xxxxxx\StilgoeP | 01/06/2011 09:35
Doc Icon (links to doc) – Doc Title (links to doc) – Author – Modified Date & Time
More From pstilgoe
STSADM -o backup -directory: Error Cannot open backup device Operating system error 5 (error not found)
By peter.stilgoe
STSADM -o backup -directory: Error Cannot open backup device Operating system error 5 (error not found)
Ensure the SQL service account is a domain account and it has permissions to
the Shared folder.
Also ensure the account used to execute the backup command has the correct rights on the DB’s as per MS recommendations ie. Owner, creator etc.
More From pstilgoe
Excel Web Services: Error http://myserver:56737/SharedServices1/ExcelCalculationServer/ExcelService.asmx exception: The request failed with HTTP status 403: Forbidden (Forbidden port)
By peter.stilgoe
Im having a problem on a MOSS 2007 farm where if I try & open a spreadsheet in Excel web services I get the error:
Excel Web Access
An error has occurred.
Please contact your system administrator if this problem persists
And in the Sharepoint logs:
Error http://myserver:56737/SharedServices1/ExcelCalculationServer/ExcelService.asmx exception: The request failed with HTTP status 403: Forbidden (Forbidden port)
If I search Google there doesnt appear to be any results for the error ‘The request failed with HTTP status 403: Forbidden (Forbidden port)’ and Im really stumped now.
If anyones got any ideas much appreciated !
TIA……..
UPDATE: If you get this problem the solution in my case was to by pass the proxy for local requests, this was done by editting the web.config for the relevant web app & adding:
<system.net> <defaultProxy> <proxy proxyaddress="http://<ProxyServer>:<port>" bypassonlocal = "true"/> </defaultProxy> </system.net>
Some more info about bypassonlocal can be found here: ByPassOnLocal MS KB
More From pstilgoe
Sharepoint: Removing illegal characters from filenames prior to bulk uploading
By peter.stilgoe
If you are doing a migration from a filesystem to Sharepoint you will more than likely come across problems uploading documents to Sharepoint that contain illegal characters in their filenames.
In Sharepoint the following characters are classed as illegal characters – & ” : * ? <> # {} % ~ / \ Tab
The + character can also cause problems & should be avoided in filenames & sitenames.
Below are some useful Powershell scripts to help you remove the illegal characters prior to uploading your documents to Sharepoint.
List all files containing a specific character (in this case ‘&’)
gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")}
Count the number of files containing a specific character (in this case ‘&’)
(gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")}).Count
Replace a specific character with another, in our case the ‘&’ with the word ‘and’
gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")} | % {rename-item $_.fullname -newname ($_ -replace "&","and")}
More From pstilgoe
Pingar – Discover new value from unstructured data
By peter.stilgoe
This looks very interesting tool & very useful in creating and maintaining your companies taxonomy.
“At PINGAR we have been building semantic search applications for business enterprises since 2007.
Consider the facts. The volume of data companies need to manage is growing 40 percent a year. Fifty percent of data searches are unsuccessful — employees may lose up to 25 percent of their productive time searching for information. And the cost to enterprises from failed searches is approximately USD $5.3 million per year, for every 1000 enterprise workers employed.
PINGAR’s research teams had three objectives:
•Deliver applications to assist enterprise workers to find more relevant data, faster
•Improve employees’ search experience
•Improve enterprise productivity and drive down costs.
These objectives were achieved with PINGAR’s Microsoft SharePoint 2007 and 2010, and Apache SOLR semantic search applications. Each can be purchased as an easy to install ‘plug-in’ server application, for distribution across enterprise networks.”
Find out more Pingar.com
More From pstilgoe
K2 Blackpoint In one way trust environment – process not showing as running in K2 Process Portal
By peter.stilgoe
Configuring K2 Blackpoint in a one way trust as per previous post. Deployed a new process & then triggered it by creating a new document. The process started & I could click on it & see it as ‘In progress’.
When I went to the K2 Process Portal the ‘Processes’ webpart showed the process as deployed with all the relevant data. However the process never displayed in the K2 Worklist webparts nor did it show as ‘Running’ in the K2 Instance Summary Webpart.
This is because the account that you are using to run your Sharepoint web application needs ‘Admin’ & ‘Impersonate’ rights on the K2 server.
More From pstilgoe
The K2 Setup Manager requires the logged on user to have domain user privileges to proceed
By peter.stilgoe
Installing K2 Blackpoint / Blackpearl in a one way trust environment you need to run the K2 server service account & application pool using an account from the ‘trusted’ domain. It is also recommended that you install K2 components using this account:
Note: It is recommended to install all K2 components using the K2 Service Account. Log on to the server as the K2 Service Account before installing.
However if you try you will get the following error:
“The K2 Setup Manager requires the logged on user to have domain user privileges to proceed”
As you are in a one way trust environment you cant easily give the required permissions (if at all) so the work around is –
“If you have a scenario where you have multiple domains, you can disable the Installer’s domain check. 1. Please browse to the directory where you are executing the installation files from. 2. Look for an configuration file called product.config. This file will reside in the installer directory. 3. Please edit the file and change the Domainusercheck from true to false as shown below. 4. Save the file and execute the setup.exe again.
setting key=”domainusercheck” value=”false”
source: K2underground
More From pstilgoe
How to restart the Sharepoint Timer Service (SPtimer)
By peter.stilgoe
SharePoint 2010: net stop SPTimerV4 / net start SPTimerV4
SharePoint 2007: net stop SPTimerV3 / net start SPTimerV3
SharePoint 2003: net stop SPTimer / net start SPTimer
More From pstilgoe
K2 Blackpoint Blackpearl not showing in Sharepoint Central Administration
By peter.stilgoe
If you are installing K2 Blackpoint / K2 Blackpearl in a distributed Sharepoint environment, you install K2 for Sharepoint on your web front ends but the K2 section still doesnt appear in Sharepoint Central Administration.
This is probably because you are hosting your central admin web app on a different server ie. an application server, if this is the case you need to install K2 on this server hosting your central admin as well as your Sharepoint Web Front End servers.
More From pstilgoe
Sharepoint CQWP: XSL to link document icon to document and open in edit mode
By peter.stilgoe
The xsl code will display & make the document icon link to the sepcific document & open it in edit mode in your content query webpart:
<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
</xsl:attribute>
</xsl:if>
<img class="image" src="{@DocumentIconImageUrl}" title="" />
</a>
Sharepoint CQWP How to format date from mm/dd/yyyy to UK dd/mm/yyyy
By peter.stilgoe
To format your Sharepoint content query webpart to UK date format do the following:
In your ItemStyle.xsl add the following line to your declarations:
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
Then use the following line to display & format your date field in UK date format:
<xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDate(string(@Modified), 2057, 5)" />
@Modified is your date field that you want to format



January 26th, 2012
