View Single Post
  #2  
Old 07-09-2010, 09:01 AM
crawfos crawfos is offline
Member
 
Join Date: Jul 2010
Posts: 7
crawfos has 10 reputation points
Default

I got this working with one small glitch. If I run the script on any date other than the first, it uses that date as the start date for the report. I.E. if I run the report today, 7/9, it uses 6/9 as the start date. So the report has no data.
Anyone know how to write it so it would use the first of the previous month no matter what day you run it?

Here's my current script. The changes I made are highlighted.

'LANGUAGE=ENU
'SERVERNAME=172.24.211.50
Public Sub Main()
Dim Lastmonth
LastMonth = DateAdd("m", -1, Date)

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Agent: Group Summary Monthly: Export Data"
'## Parameters.Add "Report: Historical: Agent: Group Summary Monthly: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Agent\Group Summary Monthly","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "3645","_Top"
'## Parameters.Add "5775","_Left"
'## Parameters.Add "13095","_Width"
'## Parameters.Add "6900","_Height"
'## Parameters.Add "The report Historical\Agent\Group Summary Monthly was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "AIR","Agent Group"
'## Parameters.Add "LastMonth","Dates"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\crawfos\My Documents\agenttable.txt","_Output"
'## Parameters.Add "44","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"
On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Agent\Group Summary Monthly")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Agent\Group Summary Monthly was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Agent\Group Summary Monthly was not found on ACD 1."
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.Window.Top = 3645
Rep.Window.Left = 5775
Rep.Window.Width = 13095
Rep.Window.Height = 6900


Rep.SetProperty "Agent Group","AIR"

Rep.SetProperty "Month Starting", LastMonth



b = Rep.ExportData("C:\Documents and Settings\crawfos\My Documents\agenttable.txt", 44, 0, True, True, False)


Rep.Quit

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
'## cvs_cmd_end
End Sub
Reply With Quote