Advanced Computed Field - updated with XSL


Yesterday I updated the download and source code for the Advanced Computed Field at the Ventigrate Public Code Repository with an XSL stylesheet. This was needed to fix an issue with the field not rendering values when filtered through a Web Part Connection.

The Advanced Computed Field relies on CAML to have the most flexibility of formatting, since SharePoint 2010 introduces XSL based Fields I updated it with the CAMLRendering=”TRUE” flag. This seemed to work for everything except an issue reported by Federico Sanchez regarding Connected Web Parts.

Federico came with the solution to the problem by adding the XSL stylesheet (nothing else needed to be changed), so it really is a nice solution.

<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"> <xsl:template match="FieldRef[@FieldType='AdvancedComputedField']" mode="Computed_body"> <xsl:param name="thisNode" select="."/> <xsl:value-of select="ddwrt:HtmlDecode($thisNode/@*[name()=current()/@Name])" disable-output-escaping="yes"/> </xsl:template> </xsl:stylesheet>

Solution upgrade

If you’re using the Advanced Computed Field in SharePoint 2010, it is advised to update the Solution Package (WSP) to the latest version (available in the download). It won’t break the existing use.

Download: link

 


Links to this post

Comments

Thursday, 26 Sep 2013 02:08 by Mario
Hello Steven, We like and use your Computed Column. Question: Is it possible to format a date column? Kind regards, Mario

Monday, 30 Sep 2013 10:40 by Steven Van de Craen
Hi Mario, you could format it using javascript (http://stackoverflow.com/questions/1056728/formatting-a-date-in-javascript). Is that what you're looking for ?

Monday, 26 May 2014 11:28 by Mario
Hello Steven, We would like to include a Person field in a div. Which basically works fine but it is presented as a link to the user. Do you know how to call only as text? Kind regards, Mario

Tuesday, 27 May 2014 04:19 by Steven Van de Craen
Hi Mario, For SP2010 you might be able to use the ACF with a javascript to filter out just the value you want. For SP2013 I recommend looking into JSLink for custom field rendering because SP2013 won't allow you to use scripts in the DisplayPattern anymore.

CAPTCHA Image Validation