Ignore folder structure in Document Library - Use Metadata to filter, group and sort results - SharePoint Development & Administration + InfoPath

Tuesday, March 24, 2009

Ignore folder structure in Document Library - Use Metadata to filter, group and sort results

The following screenshot (MOSS 2007) shows the setting that is required when creating a view to display all documents in the library, ignoring the directory structure. This page can be accessed from any document library or list by selecting "Modify this View" or "Create View" from the View dropdown menu.



Using this feature can increase relevance of the items/results displayed from the library as sorting and grouping can be performed using metadata without displaying folders. When using this method, the directory structure is preserved.

Posted as a solution to http://www.sharepointblogs.com/forums/p/20623/44064.aspx#44064 on 10/03/09

Share this article:
Stumble This Delicious
Delicious
submit to reddit
Facebook
MySpace
MySpace

2 comments:

Daniel Soutter said...

Ignore folder Structure in Data View Web Part:

If you are using a DataView Web Part to display document from a SharePoint Document Library which contains folders, you can configure the data source linked to the Data View Web Part to ignore folders similar to the above which is configured in the Libraries View Settings.

To configure a Data View Web part to ingnore the directory structure (display all documents within each folder in the document library), open the "Data Source properties" of the data souce for the doucument library containing folders and files, by opening the "Data Source Details" tab and selecting the link at the top with the same name as the data source (usually the title of the SharePoint Document Library).

Select "Recursive All" for the Item and Folder Scope of the data source.

If the document library is on a diferent SharePoint site to the site containing the page with the Data View Web Part which displays items from the document library, the Web Part may state that "The server returned a non-specific error when trying to get data from the data source..." when viewing using Sharepoint Designer. In most cases, this message can be ignored, as the Data View will load properly without an error in a browser.

Daniel Soutter said...

If SharePoint Designer displays the "The server returned a non-specific error when trying to get data from the data source..." message for the results of the Data View Web Part after RecursiveAll has been set, this can be fixed by doing the following:

1. Create a standard Data View Web Part to display items from the required list or library using SharePoint Designer's interface, or by adding the Web Part to the page using a browser and converting it to a Data View using SharePoint Designer.

By default, the Data View Web Part should display items from the root of the document library. Any items in subfolders will not be displayed by the Data View.

2. Find the "cc1:SPDataSource" tag or similar in code for the Data View Web Part.

3. Add an attribute "Scope" with a value "RecursiveAll" if the attribute is not already in the tag, or add the attribute to the tag beside the "ID" attribute as follows:

<cc1:SPDataSource ... Scope="RecursiveAll" ID="dataSourceName/ID" ... >

Results displayed by the Data View will now include files contained in subfolders in the Document Library.

Post a Comment