1,668 articles and 12,355 comments as of Tuesday, August 17th, 2010

Tuesday, May 12, 2009

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

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:

  1. 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.
  2. 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:
  3. 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>
  4. 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.
  5. 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.
    Data View Web Part Basics
  6. 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

    Data View Web Part Basics
  7. 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>.
  8. 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.
  9. 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.
  10. When the DVWP is first inserted, the “Common Data View Tasks” menu is automatically displayed. 

Data View Web Part Basics

Future articles will go into detail about configuration options such as the ones in this list.  Stay tuned.

Laura RogersAuthor: 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.

View all entries in this series: LauraRogers - Data View Web Part Basics»
 

Please Join the Discussion

21 Responses to “Data View Web Part, The Basics – Insert a DVWP on Your Page”
  1. Rao says:

    Hi,

    Can you please provide me the details of Database Connections with ORACLE. I tried in different way but, No luck.

    Thanks

  2. Lynnda says:

    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 -

  3. osevaldo says:

    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.

  4. Adam Cogan says:

    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

  5. Aru says:

    Hi can I join two list located in two different site with DVWP

  6. Varun Sharma says:

    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

  7. kurt says:

    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

  8. LD says:

    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.

  9. Laura P says:

    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

  10. Anusha says:

    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.

Trackbacks

Check out what others are saying about this post...
  1. [...] Data View Web Part, The Basics – Insert a DVWP on Your Page [...]

  2. More SharePoint 2010 Details, Reports from TechEd 2009, New Geneva Beta Available…

    Top News Stories New Microsoft SharePoint 2010 Details Start to Emerge (ZDNet) The few bits I’ve…

  3. [...] Data View Web Part, The Basics – Insert a DVWP on Your Page [...]

  4. [...] already added the document library to the page as a data view web [...]

  5. [...] Data View Web Part, The Basics – Insert a DVWP on Your Page - This is a very simple set of instructions on how to insert a data view web part onto a web part page.  Future articles will go into more detail.  [...]

  6. [...] multiple edit form is another option.  In the first article in this series, we showed how to insert a data view web part onto a web part page.  Here’s how to insert a multiple edit form [...]

  7. Display Related items in Display Form Page…

    With over 1,000 Internet sites running on SharePoint listed on my site, I have been looking at ways to…

  8. [...] of all, for beginners, here’s my Data View Web Part, The Basics – Insert a DVWP on Your Page and there’s an associated screencast, too.  (There’s a whole series of mine on data [...]




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!