locked
how to filter the view of my document library ? RRS feed

  • Question

  • i 'm a sharepoint admin in my company, we have a document library in MOSS 2007 and we would like to have two webparts which show the documents within that library but in two different view. these view should filter the list of the documents automatically,, one view should list the new documents only (latest uploaded to the library) and the other one to show the updated documents only. How we can achieve that

    please advice me,
    thanks in advance
    • Moved by Mike Walsh FIN Wednesday, August 12, 2009 7:33 AM admin q (From:SharePoint - Enterprise Content Management)
    Wednesday, August 12, 2009 7:26 AM

Answers

  • Nothing to do as far as I can see with ECM - just a standard doc lib question.

    Moving to Admin.

    -------------------


    For View one you create a View sorted in descending date order (based on the Created field) - that gives you the latest new documents at the top and you can restrict the number on the page.

    For View Two you create a View sorted in descending date order (based on the Modified Field) but exclude all the documents where Created = Modified  - that gives you at the top the latest updated documents

    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
    Wednesday, August 12, 2009 7:32 AM
  • The first thing you'll need to do is to create two views for your document library, then add two instances of the document library's web part to the page and use the two views in each web part to show the different information.

    To create a view, take the following steps:
    1. Open the library you want to use.
    2. Above the listed documents, you should see a dropdown menu to the right listed as View: <name of the current view> . Click that menu and select the Create View option by clicking on it.
    3. Select the Standard View as the selected format by clicking on its link.
    4. In the Create View: <library name> page, give your view and name and complete the rest of the sections to meet the needs of your given view. I'll walk you thru the possible ways you can configure each view to meet your needs below.
    5. Make sure the view is set as a Public View .
    6. Click the OK button to save your configuration and create the view.
    For the new documents, I think your best bet is to sort the view based on the date the document was created. In the Sort section, select the Created column in the First sort by the column: dropdown menu, then select the Show items in descending order radio button so that the documents are sorted by most recent to least recent. If you only want to display a set number of new items in this list, expand the Item Limit section further down the page and enter the number of new items you want shown in the web part and select the radio button option that you feel best meets your needs.

    For updated documents I would follow the same approach for configuring the view, but use the Modified column for the Sort order, instead of the Created column.

    Once you have created your views, here's the steps to add web parts to your page to use those views:
    1. Open the page you want the lists to be displayed on, and select the Edit Page option from the Site Actions menu in the upper right portion of the page.
    2. You should now see the various web part zones on the page where you can add your document views. Click the Add a Web Part button for the zone you want the web parts placed in.
    3. The Add Web Parts -- Webpage Dialog window will open. Locate the Lists and Libraries section and click the checkbox next to the name of the document library containing the documents you want show, the document library where you created the two views I walked you through above. Click the Add button to place the web part on the page.
    4. The web part should now appear on the page. Click the edit dropdown menu in the upper right portion of the web part and select the Modify Shared Web Part option.
    5. You should now see a dropdown menu labled Selected View . Click it and select your New Documents view from the list. You may be prompted with a warning message, click the OK button to continue.
    6. This is optional, but I would highly recommend it to avoid confusing your users. Expand the Appearance section below the Selected View menu. Change the Title field value to something like "New Documents in Library X". This will set the text that appears in the web part's headline on the page, so that your users understand what they're looking at.
    7. Change any other settings you may want to, then click the OK button to save your changes to the web part.
    To add the view of the Modified Documents, simply repeat the steps above and select the Modified Documents view in Step 5. Keep in mind that you can add multiple instances of a single web part to a page, allowing you to use these different views to provide different perspectives of your document library. This is why Step 6 is important, so that you can label each web part to avoid confusion on the part of your users.

    Let me know if this does or doesn't work for you, but I think its going to give you want you want for your users to view your documents.

    John
    MCTS: WSS v3, MOSS 2007, and SCOM 2007

    Now Available on Amazon - The SharePoint 2007 Disaster Recovery Guide.
    Thursday, August 13, 2009 2:39 PM
  • Hi,

     

    If you do not want to use the new view following John’s advices, you could edit the Current View of the added web part.

     

    To do this, following john’s suggestion to add the web part and Click Edit the current view in the *Step 5:You should now see a dropdown menu labled Selected View*.

     

    From your description, I suppose you want to display the items updated in 7 days. You could add the filter:

    Modified

    Is greater than

    [Today]-7

     

     

    Hope the information can be helpful.

    -lambert


    Sincerely,
    Lambert Qin | Microsoft TechNet Managed Forum Support
    Posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, August 18, 2009 8:04 AM

All replies

  • Nothing to do as far as I can see with ECM - just a standard doc lib question.

    Moving to Admin.

    -------------------


    For View one you create a View sorted in descending date order (based on the Created field) - that gives you the latest new documents at the top and you can restrict the number on the page.

    For View Two you create a View sorted in descending date order (based on the Modified Field) but exclude all the documents where Created = Modified  - that gives you at the top the latest updated documents

    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
    Wednesday, August 12, 2009 7:32 AM
  • thanks Mike for the fast reply,
    how can i do the exclusion?

    Wednesday, August 12, 2009 8:08 AM
  • The first thing you'll need to do is to create two views for your document library, then add two instances of the document library's web part to the page and use the two views in each web part to show the different information.

    To create a view, take the following steps:
    1. Open the library you want to use.
    2. Above the listed documents, you should see a dropdown menu to the right listed as View: <name of the current view> . Click that menu and select the Create View option by clicking on it.
    3. Select the Standard View as the selected format by clicking on its link.
    4. In the Create View: <library name> page, give your view and name and complete the rest of the sections to meet the needs of your given view. I'll walk you thru the possible ways you can configure each view to meet your needs below.
    5. Make sure the view is set as a Public View .
    6. Click the OK button to save your configuration and create the view.
    For the new documents, I think your best bet is to sort the view based on the date the document was created. In the Sort section, select the Created column in the First sort by the column: dropdown menu, then select the Show items in descending order radio button so that the documents are sorted by most recent to least recent. If you only want to display a set number of new items in this list, expand the Item Limit section further down the page and enter the number of new items you want shown in the web part and select the radio button option that you feel best meets your needs.

    For updated documents I would follow the same approach for configuring the view, but use the Modified column for the Sort order, instead of the Created column.

    Once you have created your views, here's the steps to add web parts to your page to use those views:
    1. Open the page you want the lists to be displayed on, and select the Edit Page option from the Site Actions menu in the upper right portion of the page.
    2. You should now see the various web part zones on the page where you can add your document views. Click the Add a Web Part button for the zone you want the web parts placed in.
    3. The Add Web Parts -- Webpage Dialog window will open. Locate the Lists and Libraries section and click the checkbox next to the name of the document library containing the documents you want show, the document library where you created the two views I walked you through above. Click the Add button to place the web part on the page.
    4. The web part should now appear on the page. Click the edit dropdown menu in the upper right portion of the web part and select the Modify Shared Web Part option.
    5. You should now see a dropdown menu labled Selected View . Click it and select your New Documents view from the list. You may be prompted with a warning message, click the OK button to continue.
    6. This is optional, but I would highly recommend it to avoid confusing your users. Expand the Appearance section below the Selected View menu. Change the Title field value to something like "New Documents in Library X". This will set the text that appears in the web part's headline on the page, so that your users understand what they're looking at.
    7. Change any other settings you may want to, then click the OK button to save your changes to the web part.
    To add the view of the Modified Documents, simply repeat the steps above and select the Modified Documents view in Step 5. Keep in mind that you can add multiple instances of a single web part to a page, allowing you to use these different views to provide different perspectives of your document library. This is why Step 6 is important, so that you can label each web part to avoid confusion on the part of your users.

    Let me know if this does or doesn't work for you, but I think its going to give you want you want for your users to view your documents.

    John
    MCTS: WSS v3, MOSS 2007, and SCOM 2007

    Now Available on Amazon - The SharePoint 2007 Disaster Recovery Guide.
    Thursday, August 13, 2009 2:39 PM
  • John,
    Thanks for the long explanation, it is straight forward and it is work excellent for the new document view,
    But still to filter the view of the updating document as it still showing the new with the updating documents.

    I’m trying to solve this, what I did is that I’ve create a Calculated column (named as Updated) and I set the following formula ( =Modified>Created ) as if it is new document then the modified date = created date. plus I choose data type as date and time then I tried to filter the view based on this column (Updated). The problem is the Today filter will not help me in this case!

    I gave up; I don’t know how I can show the updating document and hide the new documents.

    Guys any advice?

    Tuesday, August 18, 2009 4:44 AM
  • Hi,

     

    If you do not want to use the new view following John’s advices, you could edit the Current View of the added web part.

     

    To do this, following john’s suggestion to add the web part and Click Edit the current view in the *Step 5:You should now see a dropdown menu labled Selected View*.

     

    From your description, I suppose you want to display the items updated in 7 days. You could add the filter:

    Modified

    Is greater than

    [Today]-7

     

     

    Hope the information can be helpful.

    -lambert


    Sincerely,
    Lambert Qin | Microsoft TechNet Managed Forum Support
    Posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, August 18, 2009 8:04 AM
  • I already did all of that, it is works fine with the new documents but still give me the new documents with the updated documents in the updated documents view!!

    I think I need a way to exclude all documents where Created date = Modified date, this will give me the updated documents only. But how I can do that??

    anyone has any idea? please let me know because I tried a lot with no luck!!
    Sara

    Sunday, August 23, 2009 3:53 AM