Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

RE: Do Until Loop using NotesViewEntryCollection Not Working
Marilyn Laudadio 7.Dec.05 12:05 AM a Web browser
Domino Designer -- LotusScript Release 5 Windows XP


Couple of things...some typo's here and here that I've noted below.

You had remarked out the First DO loop, so if vEntry was nothing then count is nothing. When you instantiate mArray(count-1) then you will throw an error.

Also, not sure why after the mArray(Count) = vc.Count you add the do-loop with the vc.entries, since the vc collection will return the document count, right?

I find it easier to align two arrays if I use a for/next loop to assign values. Also, you instantiated the mArray as string, so I converted the numeric counts to strings..if you want them to line up in a report, you might want to format(vc.count, "000")

Here is revised code - untested:

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

Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim viewTotal As NotesView
Dim vc As NotesViewEntryCollection
Dim VCTotal As NotesViewEntryCollection 'TYPO HERE: DimVCTotal
Dim report As NotesDocument 'TYPO HERE: Notes Document
Dim dt As New NotesDateTime("")
Set db = s.CurrentDatabase
Set report = db.CreateDocument
report.Form = "Monthly Report NEW"

Dim mArray() As String
Dim gArray() As String

Dim count As Long
Count = 0
Redim mArray(count)
Redim gArray(count)

'get view
Set view = db.GetView("view")

'create view navigator
Dim vNav As NotesViewNavigator
Set vNav = view.CreateViewNav

'get first entry of navigator
Dim vEntry As NotesViewEntry
Set vEntry = vNav.GetFirst

'get all categories in the view navigator
Do Until vEntry Is Nothing '<<TYPO HERE - DO IS REMARKED OUT
gArray(count) = vEntry.ColumnValues(0)
count = count + 1
Redim Preserve gArray(count)
Set vEntry = vNav.GetNextCategory(vEntry)
Loop

'use the size of the gArray to redimension the mArray to hold doc counts
'ml: If vEntry was nothing then count is 0 so you have to trap for this
If count-1>=0 Then
Redim mArray(count - 1)
'Also might want to trim the last gArray entry since you're searching for it
If gArray(Count)="" Then
Redim Preserve gArray(Count-1)
End If
Else
Redim mArray(0)
End If

%REM
'reset count variable to use below
'count = 0
'**********
%END REM

'get number of docs for each team
'ML: might be easier to align the arrays if you use the for next
For k = Lbound(gArray) To Ubound(gArray)
If gArray(k)<>"" Then
Set vc = view.GetAllEntriesByKey(gArray(k), True)
mArray(k) = Cstr(vc.Count)
Else
mArray(k) = "0"
End If
Next

%REM
Forall team In gArray
'get view entry collection for each team
Set vc = view.GetAllEntriesByKey(team, True)
'set initial count to collection count
'<<<<<<<<<<<< mArray(count) = vc.Count >>>>>>>>>>>>>>
Do Until vEntry Is Nothing
Set vEntry = vc.GetFirstEntry()
Set vEntry = vc.GetNextEntry(vEntry)
Loop
count = count + 1
End Forall

'**********
%END REM

'add results to monthly report


End Sub



Do Until Loop using NotesViewEntryC... (Carla C. Porter... 6.Dec.05)
. . RE: Do Until Loop using NotesViewEn... (Marilyn Laudadi... 7.Dec.05)
. . . . RE: Do Until Loop using NotesViewEn... (Carla C. Porter... 9.Dec.05)
. . . . . . RE: Do Until Loop using NotesViewEn... (Marilyn Laudadi... 9.Dec.05)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow