marți, iunie 13, 2006

Distinct Items from SharePoint List

I have recently had a need to display a list of distinct items. Perhaps you have the same need, and so I will share with you how to do it.

  • Open your view in FrontPage.
  • From the Data menu, select Insert Web Part.
  • Right-Click the web-part and select Convert to XSLT Data View.
  • If the Manage View Settings is not displayed, right-click your webpart and select Data View Properties.
  • Click Sort & Group.
  • Remove all fields from the sort order column, and add the field you want to display the distinct list of. I have an issues list, and I want 'Status'.
  • Select Show Group Header and Hide Group Details, then click OK.
  • Now, you have a (very ugly) distinct item list.
Edit it and make it beautiful.

You can mix and match items to make very powerful solutions. Mix this Distinct Item technique with the Conditional Formatting Woes Solved technique and the QueryString Parameter technique, you will do something that very few people have done in SharePoint (that I know of anyway):

  1. Display the distinct items list on your page.
  2. On the same page, place a web part that has a view which is filtered using a QueryString parameter.
  3. Use Conditional Formatting, and instead of formatting list values as images, format them as URLs to pass to the view.
Using my Issues list, I now have an issues list, with a list of distinct statuses, formatted as links to filter the view by each status.

If I get enought comments on this idea, I will post step by step, because formatting the distinct values as an href is kinda tricky.

Niciun comentariu:

Despre mine

Timi-Ostravia, Republic of Czedvia, Bulgaria
I make web applications. The tools I use are many and far between. I have been maining to learn Ruby and Python, and Perl. These tools are all like Lego to me. They can all be make to build things and have their strengths and weakest.