Paul's profilePaul Galvin's SharePoint...BlogListsSkyDrive Tools Help

Paul Galvin's SharePoint space [SharePoint MVP]

SharePoint, Other Items Technical and the Occasional Humorous Article from a Microsoft SharePoint MVP
November 11

SharePoint Shop Talk Tomorrow (11/12) from 12:30PM to 1:3PM EDT

The next SharePoint Shop Talk takes place tomorrow at 12:30 PM EDT.

This is a free event to anyone that has a telephone.  A panel of SharePoint pro’s take questions and do their best to provide useful guidance and advice.  We regularly hijack audience members and make them answer questions and try to have a good time.

Send your questions or topics to questions@sharepointshoptalk.com.

Register here: https://www.livemeeting.com/lrs/8000043750/Registration.aspx?pageName=sx9p9r6prwxp5mk9

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:
November 04

SharePoint Shop Talk for Thursday 11/05/09 @ 12:30PM EDT

The next edition of SharePoint Shop Talk takes place Thursday, 11/05/09 at 12:30 PM EDT.

Register here: https://www.livemeeting.com/lrs/8000043750/Registration.aspx?pageName=gr5l4q66rv3f4xwj

SharePoint Shop Talk is an open phone line, open Q&A to talk about all things SharePoint.

If you have questions or topics that you’d like the panel to discuss, send them by email to questions@sharepointshoptalk.com or twitter them to me (pagalvin).

I’m badly rushed for time this week, so I’ll leave it at that.  I usually like to preview some of the already-emailed questions.  This week, you’ll have to dial in to hear about it :)

We hope to see you on line.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:
November 03

Comparing Dates in a Data View Web Part to Build a WSS KPI

Note: this was first posted at www.endusersharepoint.com here: http://www.endusersharepoint.com/2009/11/02/comparing-dates-in-a-data-view-web-part-to-build-a-wss-kpi-in-sharepoint/.

This is yet another blog post on comparing dates in XSL in a data view web part in SharePoint.

This is my scenario:

  • I have a custom list.
  • The business purpose of the list is to support the idea of a new employee and his/her tasks to be completed within 7 days of starting the job.
  • They are in a “warning zone” after 4 days if they have not completed these tasks.
  • I want to create a simple dashboard that shows green when they have either completed the task or if they have more than 4 days to complete it.
  • I want the dashboard to show yellow if they are in the warning zone.
  • I want to to show red if they have not completed the task after the due date.

I borrowed from this article at Marc Anderson’s blog (http://mdasblog.wordpress.com/2008/02/19/comparing-dates-in-sharepoint-using-xsl/) to get the comparison logic and this article at www.endusersharepoint.com for the basic ideas behind the dashboard (http://www.endusersharepoint.com/2008/12/09/visual-indicators-for-the-masses-kpis-in-wss/) written by Toni Frankola.

You should read the supporting blogs, but the implementation goes like this:

  1. Create a content type (columns + CT)
  2. Create a custom list and associate it with the content type.
  3. Create a web part page.
  4. Add the custom list to the web part page.
  5. Open up the page in SPD.
  6. Convert the list to a DVWP.
  7. Modify the XSL to generate the dashboard bits.

I have two dates: a warning date and a due date.  To compare the dates, my xsl does the following:

 
  <xsl:choose>
  
    <!-- When both handbook and policy are signed, we are green regardless of dates. -->
    <xsl:when test="@Employee_x0020_Handbook_x003F_ = 1 and @Security_x0020_Policies = 1">
      <img src="/_layouts/images/KPIDefault-0.GIF" alt="No problems"/>
       <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ID}&amp;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
    </xsl:when>
 
    <!-- Show amber indicator if we're past the warning date. -->
    <xsl:when test="ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd') &gt;= ddwrt:FormatDateTime(string(@TaskDueDate), 1033, 'yyyyMMdd')">
      <img src="/_layouts/images/KPIDefault-2.GIF" alt="Overdue"/>
        <a style="border: 0px" href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ID}&amp;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
    </xsl:when>
 
    <!-- Show red indicator if we're passed the due date. -->
    <xsl:when test="ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd') &gt;= ddwrt:FormatDateTime(string(@Warning_x0020_Date), 1033, 'yyyyMMdd')">
      <img src="/_layouts/images/KPIDefault-1.GIF" alt="Warning"/>        
      <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ID}&amp;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
    </xsl:when>
 
    <!-- If we get here, we're earlier than the warning date, so we're green. -->
    <xsl:otherwise>
      <img src="/_layouts/images/KPIDefault-0.GIF" alt="No problems"/>
       <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ID}&amp;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
    </xsl:otherwise>
  
  </xsl:choose>

 

A few key points from above:

  • I tried to compare dates without using the ddwrt functionality and got nowhere.  I still don’t understand that.  They dates displayed correctly, but both “>” and “<” comparisons always failed.  In the end, ddwrt came to my rescue (thanks, again, Marc).
  • I’m also displaying an [Edit] link to the item.  I mainly did this so that I could easily test this out.  The link itself may be useful to someone trying to figure it out.
  • This is implemented in SharePoint online and works nicely.
  • The images I reference in the _layouts directory (/_layouts/images/KPI…) are available out of the box in my environment so they are probably available for you as well.

Here’s a screen shot of what it looks like for me:

image

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

October 28

In Praise of jQuery Enhanced Search-As-You-Type (by Jan Tielens)

I’m working on a BPOS demo (soon to be available up on Microsoft’s site) and I wanted to add a little pizzazz.  I’ve known about Jan Tielen’s efforts for quite a while and I thought it would be a great technique to add to the demo, so I did.  You can read about it here: http://weblogs.asp.net/jan/archive/2009/07/02/sharepoint-search-as-you-type-with-jquery.aspx.  It’s so simple to use it should probably be a crime (and maybe is somewhere).

I add just two points to what he already created / wrote about:

  1. This does, in fact, work in a BPOS (SharePoint online) environment.
  2. To make it work without an annoying popup message prefix the reference to the jquery library with https instead of http, as in:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

 

Jan points out that you should probably move the library itself to your site.  Feeling a little lazy today, I decided to blog about it instead :)

</end>

This is another post in my on-going series on how to use jQuery with SharePoint.
If you want to learn more about jQuery, I highly recommend: jQuery in Action by Bear Bibeault and Yehuda Katz.

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:

October 27

SharePoint Shop Talk Thursday 10/29 at 12:30 PM EDT

The next SharePoint Shop Talk takes place this Thursday at 12:30PM EDT.

We’ve taken two weeks off (due to SharePoint Conference last week) and as a result, we have a number of questions in queue, not to mention all kinds of cool stuff to talk about regarding SharePoint 2010.  All of the panel members attended SPC, so bring your SP 2010 questions to the call or email them to questions@sharepointshoptalk.com.

Aside from a good part of the call set aside to talk about some SP 2010 goodness, we’ll also discuss:

  • Why SharePoint shows different navigation options under site settings (this varies based on features and site configuration)
  • Modifying versions.aspx – problems, difficulties doing so (I”m not surprised :) ).
  • Embedding RSS feeds into a site when the source is authenticated.
  • Using stsadm to manage logging.

Register here: https://www.livemeeting.com/lrs/8000043750/Registration.aspx?pageName=p663256djrrflfdw

As usual, send any questions or discussion topics to questions@sharepointshoptalk.com, email me directly or twitter to @pagalvin.

We hope to see you there!

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:
 

TwitterCounter for @pagalvin

My favorite books relating to SharePoint
SharePoint bloggers