Note: using the Data View Web Part in SharePoint 2007 requires SharePoint Designer (SPD), the Microsoft Web editor successor of FrontPage.
The Data View Web Part (DVWP) allows you to modify the look and feel of displayed data. The data is usually pulled from a SharePoint document library or list, or from an XML source (XML file, RSS, Web Service, etc.).
Of all the SharePoint tools made available to end users, the DVWP is certainly the most powerful. It will allow you to:
• Display a SharePoint library or list in another site
• Aggregate data from multiple sources
• Display highly customized views
• Apply conditional formatting to your data
• Display data driven charts (combined with a Flash or Silverlight charting tool for example)
• Apply advanced formatting beyond what the SharePoint UI offers (e.g. open link in new window)
• Create cross-row formulas
A warning before you start
Be aware that using SPD gives you access to the whole content of your page. You run the risk of accidentally deleting a default control, which will break your page. I recommend not using SPD on your site default pages (default.aspx for example). Instead, create a separate Web Part page (Site actions > Create > Web Part page).
As I did for the Content Editor Web Part (CEWP), I’ll just point to the best posts I have found on the Web.
The terminology can be confusing, as “Data View Web Part” and “Data Form Web Part” are used interchangeably. In SPD itself for example, you use the “Create Data View” menu, but once on the page the Web Part is called “Data Form Web Part” (more details here).
In SharePoint Designer, there are two ways to create your DVWP:
1/ by converting a SharePoint library or list. This is the easiest way. Ishai Sagi provides a very detailed tutorial here:
Creating an XSLT DataView for a sharepoint list
Note in particular the export/import tip at the end of the article.
2/ through the menu: Data View > Insert Data View. This is a more general method.
Also a good tutorial here by Raymond Mitchell (with the promise of more to come):
Getting to know the Data Form Web Part (1 of 4)
Looking for more information?
You’ll find lots of articles about the DVWP. For example, this article from Matt Smith lists several interesting links:
Data View/Form Web Part to the Rescue!
Search the Web with those keywords: “Data View Web Part”, “DVWP”, “silver bullet”, “Swiss army knife” (No kidding!). Note that a DVWP was already available in SharePoint 2003, some articles written for SP 2003 do not apply to SP 2007.
I’ll show some applications of the DVWP in future posts. Sometimes we have the choice between the DVWP and the CEWP, in such case I usually favor the CEWP as it is a safer approach. Changes can easily be undone by simply deleting the CEWP. And, of course, the CEWP will be your only choice if you don’t have SharePoint Designer.