Sharepoint: How do I filter a document library view to show the contents of a subfolder?

前端 未结 9 1440
迷失自我
迷失自我 2021-01-01 18:59

A number of business areas I work with use a folder structure to organise their Sharepoint housed documents (not ideal I know, but we\'re stuck with it).

I would l

相关标签:
9条回答
  • 2021-01-01 19:38

    What kind of document library information do you want in the view? How do you want the user to filter the view?

    In general the most powerful way of creating views in sharepoint is with the data view web part. http://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx

    You will need Microsoft Office SharePoint Designer.

    You can present different views of you folders using the data view filter and sorting controls.

    You can use web part connections to filter a dataview. You can use any datasource linked to say a drop down to filter a dataview. How to tie a dropdown list to a gridview in Sharepoint 2007?

    0 讨论(0)
  • 2021-01-01 19:39

    In SP2013 Online, I tried the filter conditions as Name Contains Folder_I_want_to_list

    This showed me all the folders containing the Name in their file path. It lists even sub-folder contents which wasn't available when i tried Name equal to Folder_I_want_to_list

    0 讨论(0)
  • 2021-01-01 19:42

    With Sharepoint Designer you can edit the CAML of your XSLT List View.

    If you set the Scope attribute of the View element to Recursive or RecursiveAll, which returns all Files and Folders, you can filter the documents by FileDirRef:

    <Where>
       <Contains>
          <FieldRef Name='FileDirRef' />
          <Value Type='Lookup'>MyFolder</Value>
       </Contains>
    </Where>
    

    This returns all documents which contain the string 'MyFolder' in their path.

    I found infos about this on http://platinumdogs.wordpress.com/2009/07/21/querying-document-libraries-or-pulling-teeth-with-caml/ and useful information abouts fields at http://blog.thekid.me.uk/archive/2007/03/21/wss-field-display-amp-internal-names-for-lists-amp-document-libraries.aspx

    0 讨论(0)
  • 2021-01-01 19:50

    You can also get a direct link to a view within a folder by using "TreeValue", "TreeField" and "RootFolder".

    Example:

    http://sharepoint/Docs/YourLibrary/Forms/YourView.aspx?RootFolder=MyFolder&TreeField=Folders&TreeValue=MyFolder
    

    To further explain: I have a SharePoint site, with a docs library called YourLibrary. I have a folder called MyFolder. I created a view that can be used at any level of that Library structure with a URL path of YourView.aspx Using that link, it will take me to the view I created, with all the filters and styles, but only show the results that would occur in the contents of that folder in RootFolder and TreeValue.

    0 讨论(0)
  • 2021-01-01 20:00

    Have you thought about creating a view with 'Folder = Show all items without folders', that would get all your documents out of their folders and then perhaps you could create your filter(s) over that view.

    0 讨论(0)
  • 2021-01-01 20:02

    Try this, pick or create one column and make that value required so that it's always populated such as title. A field that doesn't hold the name of the folder. Then in your filter put the filter you wanted that will select only the files you want. Then add an or to your filter, select your "required" field then set it equal to and leave the filter blank. Since all folders will have a blank in this required field your folders will show up with your files.

    0 讨论(0)
提交回复
热议问题