1,804 articles and 15,512 comments as of Monday, December 27th, 2010

Wednesday, May 13, 2009

Data View Web Part, The Basics – Folders

Articles in this Series

Note: As a follow-up to this article, Laura has created a terrific screencast.

When creating data view web parts in SharePoint Designer, and dealing with libraries or lists that contain folders, the Item and Folder Scope setting becomes pretty important.

In SharePoint views, it’s always possible to create a new view of the list with no folders, by configuring the “Folders” section in your view settings. Unfortunately, the same functionality is not as obvious in SharePoint Designer. When you create a view with no folders, and then convert it to XSLT in SPD, the folders always reappear.

Here’s how to modify the way folders are enumerated in data view web parts (XSLT).

  1. Open this page in SP Designer, and click in a zone, and add a data view web part. Pick your list or library (one with folders in it).
  2. In the data source library pane on the right, click the drop-down on your library, and choose "Show data". Select the fields that you would like to be displayed, and click to insert them onto the page (you can just use a multiple item view at this point).
  3. When you’re in your data view in SPD, and you have the Data Source Details pane showing on the right, you’ll see "Current Data Source" at the top of that toolpane, and a link to open the details about that current data source.

    DVWP Folders
  4. Open that link.  There’s a drop-down box that says "Item and folder scope".

    DVWP Folders
  • Default only shows the top level of folders and files in the document library.
  • Recursive shows all files in the library, with no folders
  • RecursiveAll shows all files and folders in the library, in one list.

This is an example of a document library in a data view web part, with the item and folder scope set to Recursive:

DVWP Folders

In my next article, you’ll learn how to turn these document names into links to open the documents, as opposed to the default text only formatting.

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

7 Responses to “Data View Web Part, The Basics – Folders”
  1. George W says:

    Wonderful stuff! Thanks!

  2. Erik Padron says:

    Great content Laura. I built a dynamic active documents report from the info. I’m trying to add conditional format within it, so I can determine documents that are more than a year, or documents that meet their destruction dates. Do you have any insight with that? Specificaly: [Current Date]-360 as the condition. Thank you.

  3. Paul says:

    Hi – I’m trying to set the Recursive mode external data sources that are then used in a Linked data source. It forces me to make copy and modify the external data source library, which I then set to recursive. But trying to show details gives an unspecified error. Any thoughts on how to use this for external sources?

  4. Thanks Laura!!!

    You helped me so much with writing this post. During my project work in the last week I struggled with this question hows to generate a table of content page based on serveral subfolders within a Document Library.

    With this tip “There’s a drop-down box that says “Item and folder scope” I can now enable a filter on a “Document Library” and based on a path folder cretaria show specic documents for that subfolder.

  5. Babu says:

    hi Laura,
    i ma new to this blog,
    i am working in sharepoint with 1 yr experience in asp.net(c#).
    i have one doubt.that is
    can we connect external datasource to dash boards to create barcharts in reporting services.
    waiting for u r reply.
    Babu

Trackbacks

Check out what others are saying about this post...
  1. [...] Data View Web Part, The Basics – Folders (Article) Original Publication Date: Wednesday, May 13, 2009 SharePoint User Level: Power User When creating data view web parts in SharePoint Designer, and dealing with libraries or lists that contain folders, the Item and Folder Scope setting becomes pretty important. In SharePoint views, it’s always possible to create a new view of the list with no folders, by configuring the “Folders” section in your view settings. Unfortunately, the same functionality is not as obvious in SharePoint Designer. When you create a view with no folders, and then convert it to XSLT in SPD, the folders always reappear.   3 Minute Screencast: Use DVWP to display all files, even those stored in folders! Original Publication Date: Wednesday, May 13, 2009 SharePoint User Level: Power User This short screencast is a visual walk-through of Laura’s previous article, Data View Web Part, The Basics – Folders. In this session, she show how to display all files within a library, even when those files are stored in multiple folders. [...]

  2. [...] short screencast is a visual walk-through of Laura’s previous article, Data View Web Part, The Basics – Folders. In this session, she demonstrates how to display all files within a library, even when those files [...]




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!