Sharepoint By Dummies

See Also: http://stephenbooth.brandyourself.com/

Posts Tagged ‘XSL

Date comparison sometimes uses previous day!

leave a comment »

We have a list which contains a number of date fields, in a dataview connection tot hat list we are using conditional formatting to show/hide alerters depending on if the date has past.  This is on WSS 3.0 and the alerters with their conditional formatting were added using sharepoint designer 2007.  The users reported that sometimes the alterter for overdue (i.e. the date had passed) was appearing a day early.

The XSL inserted by SPD to impklement the conditional formatting is:

<xsl:if test="normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) = 'Start Date' and number(translate(substring-before(@Planned_x0020_Start_x0020_Date,'T'),'-','')) > number(translate(substring-before($Today,'T'),'-',''))"><img alt="" src="taxi graphics/Greentick[1].gif" width="16" height="16" /></xsl:if>
<xsl:if test="number(translate(substring-before(@Planned_x0020_Start_x0020_Date,'T'),'-','')) <= number(translate(substring-before($Today,'T'),'-','')) and normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) = 'Start Date'"><img alt="" src="taxi graphics/redcross[1].gif" width="16" height="16" /></xsl:if>
<xsl:if test="normalize-space(@STATUS_x0020_FOR_x0020_DASHBOARD) != 'Start Date'"><img alt="" src="taxi graphics/gray tri.jpg" width="10" height="9" /></xsl:if>

We’ve found that in some cases the truncate on the Planned_x0020_Start_x0020_Date field returns the date of the day before the actual date recorded (so for 15-Jun-12 it returns 20120611 rarther than 20120615).

I’ve posted a question about this on EggheadCafe.

Written by stephenboothuk

June 20, 2012 at 2:33 pm

Fields show in Datasource for columns but not in filter dialogue

leave a comment »

Got handed a wierd issue this morning.  One of my colleagues had created a pair of .aspx pages each containingthe same set set of dataviews.  Each page displayed the same set of views but filtered by a different field (one by project the other by service area, the filter value being passed via a paramter in the URL, the service area page was a straight copy of the project page with just the field that was being filteredon being changed).

The project page worked fine, as did most of the dataviews on the Service Area page.  There were a couple of dataviews on the Service Area page where it was possible to insert the Service Area column into the dataview fore display but it (along with a number of other columns) did not appear in the filter dialogue.  This got passed to me to resolve.

I tried refereshign the datasources, to no avail.  I checked the XSL, seemed fine.  Similarly the lists seemed fine and the other dataviews on the page seemed fine.

To resolve the issue I located the filter line in the code and manaually changed the field name from the project column to the service area column.  This resolved the issue and then not only did the service area field appear in the filter dialogue but so did all the others that had previously been missing!

Searching the web for this problem returned no useful hits.

This was WSS 3.0 (aka Sharepoint 2007) and Sharepoint Designer 2007.

Written by stephenboothuk

January 13, 2012 at 1:55 pm

Posted in Uncategorized

Tagged with , , ,

Speeches I Would Have Given

What I would have said at conference

Mark Vale

Tech blog on Microsoft Teams & Stuff

David Hunt, PE... Mechanical Engineer on the loose!

VALUE = Creativity + Diverse Experience + Critical Thinking

catastraspie

A personal blog about having Asperger's

Marc D Anderson's Blog

A Knowledge Management Zealot Speaks Out

Codeless Solutions for SharePoint

Bryon Wyly is a SharePoint Developer dedicated to finding the limits to out-of the-box SharePoint solutions

gordonlyew.wordpress.com/

the political blog of gordon lyew

SharePoint Business Analyst

Just another WordPress.com weblog