Unfortunetely I don’t know of an easier way and logging activity and I haven’t found a way to log new report information. Basically the following script logs when the user logs in, report refresh information like time elapsed, SQL, user id, etc., and when they log out. I haven’t tested this thouroughly and I haven’t included all the data providers (only the 1st) but it should give you a start… Also this script should be stored in the BusObj script file.
Dim StartTimeSec
Dim EndTimeSec
Dim TotalTimeSec
Dim TotalHours As Integer
Dim TotalMinutes As Integer
Dim TotalSeconds As Integer
Dim BOUser
Dim BODp As BODataProvider
Sub OnStart
BOUser = Application.Variables.Item(“BOUSER”) Open “C:\Program Files\BusinessObjects\BOTime.txt” For Append As #1 Print #1, “”
Print #1, "User ID: " & BOUser & " Logged in on " & now() Close #1
End Sub
Sub OnQuit
BOUser = Application.Variables.Item(“BOUSER”) Open “C:\Program Files\BusinessObjects\BOTime.txt” For Append As #1 Print #1, "User ID: " & BOUser & " Logged off on " & now() Print #1,
“*************************************************************************** ****”
Close #1
End Sub
Sub OnBeforeRefreshDocument
StartTimeSec = (Hour(Time) * 3600) + (Minute(Time) * 60) + Second(Time) End Sub
sub OnAfterRefreshDocument
Set BODp = ActiveDocument.DataProviders.Item(1)
BOUser = Application.Variables.Item(“BOUSER”)
EndTimeSec = (Hour(Time) * 3600) + (Minute(Time) * 60) + Second(Time) TotalTimeSec = EndTimeSec - StartTimeSec
Open “C:\Program Files\BusinessObjects\BOTime.txt” For Append As #1
TotalHours = TotalTimeSec / 3600
TotalMinutes = (TotalTimeSec - (TotalHours * 3600)) / 60 TotalSeconds = TotalTimeSec - (TotalHours * 3600) - (TotalMinutes * 60)
Print #1, " User ID: " & BOUser
Print #1, " Refreshed Date/Time: " & Date & " " & Time Print #1, " Universe: " & BOdp.UniverseName Print #1, " Document Name: " & ActiveDocument.Name Print #1, " SQL: " & BODp.SQL
Print #1, " Elasped Time: Hours: " & TotalHours & " Minutes: " & TotalMinutes & " Seconds: " & TotalSeconds
Close #1
End Sub
Hope this helps…
Kent Johnson
Listserv Archives (BOB member since 2002-06-25)