Get Column Totals with LotusScript

Here is a quick post in addition to my recent post on how to get sums / subtotals for a given category in a view with LotusScript.

totalsls

Assume, you want to get the total number of solved tickets. In my sample the value in question is located in column 7 at the very end of the ($ddTickets_ByMonthRep) view.

Here is the code that does the trick.

Sub Click(Source As Button)
	Dim s As New NotesSession
	Dim db As NotesDatabase
	Set db = s.CurrentDatabase
	Dim v As NotesView
	Dim n As NotesViewNavigator
	Dim e As NotesViewEntry
	Set v = db.GetView("($ddTickets_ByMonthRep)")
	Set n = v.CreateViewNav
	Set e = n.GetLast
	If e.IsTotal Then
		Msgbox e.ColumnValues(7)
	End If
End Sub