Thursday, November 1, 2012

SharePoint 2010 Birthday webpart

Hi ,

I had a small requirement from my manager to display the team mates birth days in the team site for the current month.

I searched for the  already existing solutions in the net and able to replicate one of them using a simple OOB approach.

You just need a custom list to store the team mates names and birth day dates and need to do some calculated columns . Thats enough.

Below are the steps explained.

  1. Create a custom list named TeamBirthdayList and add the columns name, birthday as date type and other details if needed to display like mail id and mobile no.
  2. create a column named "currentdate" and make default value as today's date with date only.
  3. Create two calculated columns named "startmonth" and "endmonth".
  4. startmonth calulated formula as DATE(YEAR(currentdate),MONTH(Birthday),1)
  5. endmonth calulated formula as DATE(YEAR(currentdate),MONTH(Birthday)+1,1)-1.
  6. Now create another column named "BirthdayOrder" as calculated column to sort the list according to the date. the formula will be like this : DATE(YEAR(currentdate),MONTH(birthday),DAY(birthday))
  7. Now, add this list as listview webpart in the page and change the view settings like below steps. 
  8. Sort the items as per birthday order field .
  9. IN the filter section, startmonth is less than or equal to [Today] and endmonth is greater than or equal to [Today]
Thats it. your teams birthday webpart is ready and you can customize the styles using xslt.