Dataview Web Part – Access Denied

The Problem

When a user that is restricted from a specific list visits the site; the view of that list displays an access denied message rather than hiding the Web Part from the user.  It appears that the security for the list is evaluated prior to the Web Part evaluating the targeted audiences.  Since the user does not have access to the list, the access denied message is shown as a result.


The Solution

We can remedy this issue by granting the lowest privilege on the list for the user.  As a requirement, the user must not be able to view any list items, so we will give the user the ability to see the list, but not the ability to see any items in the list. This is accomplished by creating a custom permission level that will contain ONLY the Open permission from the Site permissions group.  This will allow users possesing this permission to open the list, but will not grant them the permission to open any items in the list.  Grant the newly created permission level to the restricted users on the list and the audience targeting on the list views will now function as intended.

Happy Birthday Web Part

I wanted to be able to show all of the employees birthday’s for the current day.  Turns out, this was not a very hard task to accomplish.  I have a field in one of my lists’ that contains a birth date field.  All of the months and days are accurate, but the years are all set to 1996 for security reasons.  In order to show upcoming birthdays, I needed to change a few things.

Here’s the deal with that.  The “Birthdate” field holds the actual birthday of the user.  In my case, 24-Jul-96.  However, I want to see it as July 24 2010.

Well, since the [Today] field in calculated column will not work (all tricks will not work – the field won’t update!), here is a solution that only asks for a yearly update to the column.

First, I created a calculated column that results in the current year “Birthdate”.  This changed the view of the date from 24-Jul-96 to July 24 2010.  Note:  “Birthdate” is the name of the column in my list that contains the actual birthday.  Yours may vary.

  1. Create a calculated column to hold this year’s birth date named “Birthday”.
  2. Set the output type of the calculated value to “Date and Time”.
  3. Set the date and time format to “Date Only”.
  4. Use this formula to generate its value.
















5.  Create a new view of the list named “Birthday” and click on the plus to expand “Filter”.

6.  Next, enter in the following.  Once you click Ok, you will see all birthdays for the upcoming week.













7.  If you only want to see the birthdays for the current day only, simply change the filter to the following.














Just remember – next year you will have to update the formula of the calculated column from 2010 to 2011.


Create an A-Z quick filter web part

If you have a list, like a corporate phone directory, you may start thinking “Man, I wish I could sort through these by the first letter of their name”.  If you weren’t thinking that, it’s ok.  I was so that why I decided to post this.  Follow these steps and your new web part will be up and running in no time.

  1. Open the list that you want to add the A-Z filter to (my case “Employee_Phonebook”)
  2. From the “Employee_Phonebook” tool bar, click “Settings –> Create Column”
  3. Name the column “A-Z” or whatever name you would prefer
  4. Select “Calculated” as column type
  5. Under Additional Column Settings, select “Title” from Insert Column and type =LEFT([Title],1) into Formula. Keep all default settings and click “OK”.  Note: “Title” is the name of the column you are targeting for this list (i.e. Last Name)
  6. You will see new column called “A-Z” and has the letter “A” value in them already.
  7. From the Site Actions tab, click Edit Page
  8. Click Add a Web Part and add the “Content Editor Web Part”
  9. Modify that Content Editor Web Part and click the “Source Editor” button to add the following code.
    ** Note: You will need to modify the URL’s below to reference your site.
<P align=center><STRONG><FONT size=5>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=A" target=""><U>A</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=B" target=""><U>B</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=C" target=""><U>C</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=D" target=""><U>D</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=E" target=""><U>E</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=F" target=""><U>F</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=G" target=""><U>G</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=H" target=""><U>H</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=I" target=""><U>I</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=J" target=""><U>J</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=K" target=""><U>K</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=L" target=""><U>L</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=M" target=""><U>M</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=N" target=""><U>N</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=O" target=""><U>O</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=P" target=""><U>P</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=Q" target=""><U>Q</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=R" target=""><U>R</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=S" target=""><U>S</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=T" target=""><U>T</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=U" target=""><U>U</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=V" target=""><U>V</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=W" target=""><U>W</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=X" target=""><U>X</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=Y" target=""><U>Y</U></A>
 <A title="" href=" List Name/AllItems.aspx?FilterBook=Z" target=""><U>Z</U></A>


  1. Click “Add a Web Part” and add “Query String (URL) Filter”
  2. Enter a name for “Filter Name” then enter “FilterBook” into “Query String Parameter Name” then click “OK”
  3. Now from Query String (URL) Filter, select Edit –> Connections –> Send Filter Values to “Employee_Phonebook” and when the Popup appears select “A-Z”
  4. Click the Finish button and your done

Your finished product will look similar to the image below

Show Start and End time on a SharePoint calendar

If you have ever wondered if  it would be hard to show both the start and end times on a SharePoint calendar, stop wondering!

This can be performed in six simple steps.

  1. Create a calculated column.  Name the column “Time of Event”
  2. Insert this formula: =TEXT([Start Time],”h:mm AM/PM”)&” – “&TEXT([End Time],”h:mm AM/PM”)&” : “&Title
  3. For data type, select “Date and Time”
  4. For date and time format, select “Date and Time”
  5. Click OK
  6. Modify Calendar View:  Change monthly view title under calendar columns to “Time of Event”

The new entry will look similar to the image below:

Improperly setup AD account can cause issues

If you are using the people picker column in a list, watch out.  You could be faced with an odd little issue.

Recently, I created a list to control the views in an InfoPath form.  This list uses a people picker column that pulls the “UserName”.  What I noticed was that three of the users were displaying differently.  Instead of all lowercase letters, the first two letters of the username were capitalized.  As it happens, one of those users was unable to see a certain view that they had access to.

I had our AD guy change the names of the users to all lowercase letters.  I then ran a full AD import into SharePoint.  I waited a little while, pressed CTRL+F5 on my keyboard and noticed that the name changed in the permission checking list.

I logged in as the user and was now able to see the correct view.  Weird huh?

SharePoint 2007 – Enable left navigation for Web Part pages

If you have published an InfoPath form to a SharePoint site, chances are that you have created a webpart page and have published it there.
We part pages are great but you lose the left navigation and it can become confusing to some users.

There is however a simple fix that will enable the left nav for your pages. You will need to open up SharePoint Designer to do this.

  1. Open SharePoint Designer and navigate to your page
  2. Switch to code view and scroll down until approximately line 45.
  3. You see the following two lines.
  4. Highlight these two lines and delete.
  5. Save your page and that’s it!

<asp:Content ContentPlaceHolderId=”PlaceHolderLeftNavBar” runat=”server”></asp:Content>
<asp:Content ContentPlaceHolderId=”PlaceHolderNavSpacer” runat=”server”></asp:Content>
It will look similar to the image below: