Pseudo-web parts

Ever wanted to add content to a SharePoint page that could be skinned as if it were a web part? Try this:


<table><tbody><tr class="ms-WPHeader">
  <td>&amp;#160;</td>
  <td><h3 class="ms-standardheader ms-WPTitle" style="text-align: justify">
    <br/>Drop Box Instructions;&amp;#160;</h3>
  </td>
</tr>
<tr><td>;&amp;#160;</td>
  <td style="line-height: 1.4">  

Delegating sub-site creation while inhibiting site deletion

If you've ever administered SharePoint, then you'll know that one of the hardest parts is knowing how much control to delegate to users. Should they be able to set themes? Change Web Parts displayed? Customize lists?

Keep track of SharePoint page movements

To make the Close buttons work properly in SharePoint, just add this piece of JavaScript in your hyperlinks:


<a href="/Docs/Lists/Announcements/DispForm.aspx?ID=1" 
onclick="GoToLink(this);return false;">View item</a>

(Thanks to http://kwizcom.blogspot.com/2008/07/how-to-add-source-parameter-to.html for the tip!)

Convert SharePoint date to serial using XSL

Another day, another SharePoint limitation.

Since you can't use Lookup fields in calculations, if we are trying to compare a Date being used as a Lookup key for a view then we have to resort to XSL. The following template will convert a SharePoint date to a serial number (UPDATE: oops -- made a beginner XSLT mistake and was assigning to variables, not parameters. The revised code is below. UPDATE 2: For some reason, certain select statements using the floor() function made value-of statement static. A better nested version below fixes this bug too.)

Creating a list with dynamically filtered date range

Okay, so some context. What I am trying to do is use two web parts, with the first providing a date that can be used to dynamically filter the rows shown below:

In my case, a report date is used to filter what projects are listed. The rules are:

(1) Start Date of project must be after the Report Date
(2) [End Date of project + 3 months] must be after the Report Date

Sounds easy right? Well, this is SharePoint, so no.

Date comparison in SharePoint views

It can be a real pain to successfully filter views in SharePoint Designer based on Date Ranges in XSLT List Views because SharePoint doesn't seem to be able to parse date comparisons. Possibly using ISO8601 format would work but this seems to require the use of custom SharePoint code which I am working on ways to avoid!

The only option is to convert the Dates and/or Times you want to compare to a serial value using a Calculated column, like so:


=DATE(YEAR(Date),MONTH(Date),DAY(Date))
 +TIME(HOUR(Date),MINUTE(Date),SECOND(Date))

XSLTListViewWebpart and filters

This morning's lesson -- the XSLTListWebPart starts to break horribly in Designer as soon as you deviate from Microsoft's expected templates and patterns.

Case in point: as soon as you use multiple <xsl:template name=""> elements in the stylesheet, the Filter stops working. There's a caveat on that -- it works as long as you delimit the templates using the mode="" attribute and call them using <xsl:apply-templates> rather than <xsl:call-template name="">. So for example:

Here we go again

My current organization is rolling out SharePoint 2010, and wants to use it as a platform for business productivity applications.

I think this is great, but it means that I have to delve back into the hell that is SharePoint Designer again.

VB web services with Office 2007 and newer

One quick tip for those trying to code SOAP services using VB. On Office 2007 and newer, you'll need to use the MSSOAP30.DLL library which means changing the new object call from:


CreateObject("MSSOAP.SOAPClient")

to:


CreateObject("MSOSOAP.SOAPClient30")

Because this returns an IXMLDOMSelection object, you also no longer need to specify the .childnodes member. So the general purpose script now looks like this:

Choosing between database types

If you're ever thinking of moving beyond SQL and the relational database world, this carsonified.com article is well worth your time.

It covers most of the major players, including Hadoop, CouchDB and Sesame.

Syndicate content