24 Nov, 2008
Displaying a number of items in a list
Posted by: Toni Frankola In: SharePoint
A customer recently approached me with a simple request: how to show total number of employees on his home page.
They are using a SharePoint Contacts list as a central phone book for their company. It is an interesting use case and I will try to provide more details about it in future posts.
Although you can show totals as built-in view, formatting is a bit limited. Built-in web parts like Content Query Web Part do not allow you to show total items in a view. The easiest way to create these views is to use built-in Data View Web Part and customize its XSL stylesheet.
The following figure shows the final result. (Outlined in red color: A web part showing the total number of employees; Outlined in blue color: A web part showing the total number of employees per department).
In my next post I will describe a step by step guide on how to build these web parts.
In additional to this one, you can use the same approach for different scenarios.