Trying to get a collection of documents but only the categories

Hi,

Can I get a collection document with only categories. I have a view that contains about 3000 documents and I have to get only the categories in a collection can that be done.

thanks

A.

Subject: Trying to get a collection of documents but only the categories.

You can use the NotesViewNavigator to scan NotesViewEntries and find out if they are categories through the IsCategory property. You can store the result in an array or what ever you want.

You can also use a DBColumn, which is a lot simpler. That can be stored in an array through the Evaluate command in LotusScript.

Ben Dubuc

Montreal, Canada

Subject: RE: Trying to get a collection of documents but only the categories.

thanks,

so basically I need to do this

var = Evaluate({@DbColumn(“”; “”; “(viewLookup)” " ; 1)})

what I need to do is to loop throught the categories and for each categories I need to find out how many documents are each of them.

Subject: RE: Trying to get a collection of documents but only the categories.

That will get your list of categories then loop through them and use one of the following

notesdatabase search function

notesview getalldocumentsbykey

notesview getallentriesbykey

You can then use the count property to get the result. Some of these are more efficient than others but with 3000 documents it may not make a noticeable difference which you use

Subject: Trying to get a collection of documents but only the categories.

You can loop through the NotesViewNavigator and get the categories with their respective count.However you will have to create a view as follows :

  1. First Column with the Category field > Categorised

  2. Second Column with formula as 1 and Column Properties (2nd tab) set to Total with “Hide detail rows” checked

  3. The following code will print the Category Name along with the number of documents

    Dim sess As New NotesSession

    Dim db As NotesDatabase

    Dim view As NotesView

    Dim viewNav As NotesViewNavigator

    Dim viewEntry As NotesViewEntry

    Set db = sess.CurrentDatabase

    Set view = db.GetView ( “” )

    Set viewNav = view.CreateViewNav

    Set viewEntry = viewNav.GetFirst

    While Not ( viewEntry Is Nothing )

     If viewEntry.IsCategory = True Then
    
     	Print Cstr(viewEntry.ColumnValues(0)) + " has " + Cstr(viewEntry.ColumnValues(1)) + " document(s)"
    
     End If
    
     Set viewEntry = viewNav.GetNext ( viewEntry )
    

    Wend

cheers!!

Ashish

Subject: Trying to get a collection of documents but only the categories.

Alena,

the categories you see are not documents, but instead just a Notes view feature that allows the category you have identified (usually a field or simple formula) to break the view up by that value.

Explain what you are trying to accomplish, and there may be a way to get it for you.

  • Matt