Monday, June 25, 2012

How to replace single quote in XSLT

To replace a single quote in an XSLT view of Dataform webpart, the following solution is the easiest.

The condition we wanted to check is if the column Resolution is equal to Won't Fix, since there was a single quote in the condition, the web part was failing to display. So the condition is changed like below to replace the single quote with white space.

 <xsl:value-of select="count(/dsQueryResponse/Rows/Row[translate(@Resolution, &quot;'&quot;,'') = 'Wont Fix'])"/>

Thursday, June 21, 2012

Apply borders to the XSLT Data View using SharePoint Designer

The Dataview webpart is customized by converting it to XSLT Data View.
To apply border for the XSLT Data View table using SharePoint Designer. 

In Designer, locate the table tag in the Web Part source view

<TABLE ID="{$List}-{$View}" Summary="{$List}" xmlns:o="urn:schemas-microsoft-com:office:office" o:WebQuerySourceHref="{$HttpPath}&amp;XMLDATA=1&amp;RowLimit=0&amp;View={$View}" width="100%" class="ms-listviewtable" border="0" 

Update the border="1" and also other changes based on your requirement, refer to the following post for more information about the table styles

If you applying the border for both rows and column, you'll see the border missing in the empty fields. You need to replace the empty fields with white-space.
"&nbsp;" will not work in XSLT, instead you can use &#160; 

Wednesday, June 13, 2012

SharePoint Server Error in '/' Application. The resource cannot be found.

I was getting the following error when trying to access the SharePoint site.

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /sites/companyname/default.aspx


My SharePoint site was running in port 80. In IIS, I noticed that the Default Web Site, that is supposed to be stopped, was running. I stopped the Default Web site and the SharePoint site is up and running