Data View Web Part, The Basics – Insert a DVWP on Your Page
From Mark Miller: Laura Rogers is teaching a live online workshop this Friday: Getting Started with the Data View Web Part. The series of articles starting with the one below, will go over the basics of DVWPs and show how you can build powerful, data run solutions with your existing sites.
If you like what you see over the next few days, register for the workshop and get your hands dirty!
Articles in this Series
- New Article Series: Laura Rogers on Data View Web Part Basics
- Data View Web Part, The Basics – Insert a DVWP on Your Page
As I mentioned in my previous article, I am writing a series on the SharePoint 2007 data view web part (DVWP). These web parts can only be created using SharePoint Designer (SPD). Now that SharePoint Designer 2007 is free, this opens the door to a lot more people being able to create these web parts, widening the intended audience for these articles. So let’s get started with the basics:
- In SharePoint Designer (SPD), click <File> and choose <Open Site>. Paste the full URL of your SharePoint site, such as http://sharepoint/sites/teamsite
Notice that I left out the “default.aspx” at the end of the URL. - Click <Open>
You can see that the left side of the screen shows the folder structure of your site. Each document library is a folder, and all of the site’s lists live under the “Lists” folder. At this point, the best way to start creating a data view web part (DVWP), is on a blank web part page. Go to the site in your browser, and create a web part page: - Click <Site Actions> and <Create>. Choose “Web part page”, give it a name, pick a document library to put it in, and click <Create>. Make a mental note of which doc library you picked. At the top right, click <Exit edit mode>
- Now, in SPD, on the left side, navigate to the new web part page by clicking on the name of the document library from step 3. The contents of that library will be displayed in the main work area in the middle of the SPD screen. If you don’t see your new file, click the F5 key to refresh the list.
- Double-click the name of the new file to open it.
Now, it’s time to start picking a data source to insert a data view web part. You see the web part zones displayed on the page, and each zone says “click to insert a web part”. It’s important at this point, that you pick a web part zone, and click <Click to insert a web part>. If a zone is not clicked on, a web part that’s inserted could end up on some random spot on the page.
- Click the <Data View> menu at the top of the screen, and choose <Insert Data View…>.
Since this initial article is really just to show you around in the DVWP, we’re not going to do anything fancy. We’ll just insert a regular SharePoint list as our data view. See, that now on the right side of the screen, there is a “Data Source Library” pane. The following are types of sources that you can get data from:
- SharePoint Lists
- SharePoint Libraries
- Database Connections
- XML files
- Server-side scripts
- XML Web services
- Linked Sources
- As an example, let’s grab some data that’s in a list on the site. In the “SharePoint Lists” section, pick a list (preferably one with some data in it). Click the drop-down box on that list name, and choose <Show Data>.
- Now, in the pane on the right side of the screen, instead of the “Data Source Library” tab, you’ll see the “Data Source Details” tab, that shows the details of the source that was just selected. This means, that all of the fields in the list are displayed. There are even some extra fields listed there, that are usually hidden from views. While holding your CTRL key down, click on three or four field names to select them.
- Click <Insert Selected Fields As…> right above those field names. Choose <Multiple Item View>. In various articles of this series, I’ll go over some of these other options, but this one is the most commonly used.
- When the DVWP is first inserted, the “Common Data View Tasks” menu is automatically displayed.

Future articles will go into detail about configuration options such as the ones in this list. Stay tuned.
Author: Laura Rogers, Birmingham, AL
Laura Rogers is currently a SharePoint Administrator at HealthSouth Corporation in Birmingham, Alabama. She has ten years of experience with Microsoft’s messaging and collaboration systems. This includes four years in SharePoint implementation, training, and customization. Laura has been a MCSE since 1999, with her most recent certifications being MCSE 2003 + Messaging, MCTS in MOSS and MCTS in WSS 3.0 Configuration. She also wrote a chapter in the Microsoft Office SharePoint Server 2007 Administrator’s Companion by Bill English.
- New Article Series: Laura Rogers on Data View Web Part Basics
- Data View Web Part, The Basics - Insert a DVWP on Your Page
- 6 Minute Screencast: Insert a Data View Web Part onto a SharePoint Page
- Data View Web Part, The Basics - Folders
- 3 Minute Screencast: Use DVWP to display all files, even those stored in folders!
- Data View Web Part, The Basics - Add a Hyperlink
- Data View Web Part, The Basics - Keep it Clean
- Data View Web Part, The Basics – Multiple Edit Forms
- 3 Minute Screencast: Data View Web Part, The Basics – Multiple Edit Forms
- Live Online Workshop - Data View Web Part Solutions: Part 2
- 5 Minute Screencast: SharePoint Web Services for Non-Developers
- 3 Minute Screencast: Merging SharePoint Document Libraries
- 2 Minute Screencast: Permissions Dashboard
- 4 Minute Screencast: Join View of SharePoint Lists
- Get it Together: Groups and Totals in the Data View Web Part (Screencast)
- SharePoint: Open Links in a New Browser Window (Screencast)
- How to Create a SharePoint Data View Web Part “Rollup” (Screencast)
- SharePoint: "New" Icon (Screencast)
- Display a SharePoint List on Another Site (Screencast)
- Customize the "no items" Display Text in SharePoint (Screencast)
- SharePoint: Displaying Calculated Column SUMS in a View (Screencast)
Hi,
Can you please provide me the details of Database Connections with ORACLE. I tried in different way but, No luck.
Thanks
Hello Laura, I have created DVWPs in SPD and have added the webparts to other site collections – however It has been a while and the steps to do this have slipped my mind – Once the DVWP has been created on site A – I then want to add to Site B – I believe we can export? I also have a situation where I have used HTML calculated columns to show Color code in Site A and would like very much to show the exact copy of this in Site B for viewing purpose only no editing. Thank you in advance for any info -
Dear Laura,
I ‘m beginner in this technology, but what is need to create a Web Site from SharePoint like this hosted on http://www.wssdemo.com/blog/default.aspx ?
regards
Osevaldo.
I think it would be useful to add ‘SharePoint 2007′ into the title
Useful when you are searching for ‘SharePoint 2007′ or ‘SharePoint 2010′ material
Adam Cogan
http://www.adamcogan.com
Adam – We’re using a new category for 2010 items. You’ll be able to filter by them, showing only 2010 articles. — Mark
Hi can I join two list located in two different site with DVWP
Hi Mam,
I need to connect to oracle server and to fetch data from oracle server… I have WSS and sharepoint designer and need to connect to oracle.
Can you please help me to attain this
Varun
Please post on Stump the Panel and we’ll take a look at it from there. — Mark
hello,
i want to show document library in drop down dataview part and when i select document library from drop down menu i want to see all the file in other webpart hor to do it?
Thanks
Hello,
I am creating Sharepoint pages under a Sharepoint site. The page is a web part page template. I added my web parts by importing custom web parts so I could just insert tables and add links. Easy.
OK my question is this:
When my webpart page is completed, I want to duplicate this page SEVERAL times and rename the aspx files. I want to basically make many replicas of this page. I want to use this page as a template.
Someone told me I can make a Document Library and upload the web parts I want so that when I create new webpart pages from one of the 8 templates, I can just drag and drop them in there. I created the library and have found no such functionality except adding a web bart called Document Library that only lists the links to the files so this doesn’t work.
I even tried downloading my page and uploading it into this document library but there is no button or command for copying the page when creating a new page. I am wishing for a “duplicate” button or “New from…” button that replicates the page.
Is there anything similar to this? Please help because I need to make many pages that are replicas of this page and don’t want to have to make them one by one, adding the web parts to each one!
Thanks for your time and concern.
Hi,
I can’t get past number 9 in your instructions, which say:
“Click right above those field names. Choose . ”
For me, in SPD the “Insert Selected Fields As” dropdown is grayed out so I can’t use it. Any ideas about how to get around this?
Thanks!
LP
Hi,
I am adding DVWP to dispform.aspx of a document library and i am trying to add extra fields that are related to the view. I able to add them to the webpart, but i cannot display data. I am not sure where i am going wrong can please help me with this.