I'm trying to script a montly CMS report for export but it will not work. I've read some information on modifying the script and have tried them all but it still will not run. I have no experience in VB Scripting so everything is a wing and a prayer.
Where am I going wrong???
My CMS log shows the following error:
07-07-2010 08:42:37 Begin Script Host
07-07-2010 08:42:37 Microsoft VBScript compilation error
[Line: 85] Expected statement
07-07-2010 08:42:37 Error 257 occured within the Script Host Engine.
07-07-2010 08:42:37 End Script Host
And heres the script:
'LANGUAGE=ENU
'SERVERNAME=172.24.211.50
Call Main()
PublicSub 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 "13050","_Width"
'## Parameters.Add "6855","_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 = 13050
Rep.Window.Height = 6855
Rep.SetProperty "Agent Group","AIR"
Rep.SetProperty "Dates", 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
Where am I going wrong???
My CMS log shows the following error:
07-07-2010 08:42:37 Begin Script Host
07-07-2010 08:42:37 Microsoft VBScript compilation error
[Line: 85] Expected statement
07-07-2010 08:42:37 Error 257 occured within the Script Host Engine.
07-07-2010 08:42:37 End Script Host
And heres the script:
'LANGUAGE=ENU
'SERVERNAME=172.24.211.50
Call Main()
PublicSub 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 "13050","_Width"
'## Parameters.Add "6855","_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 = 13050
Rep.Window.Height = 6855
Rep.SetProperty "Agent Group","AIR"
Rep.SetProperty "Dates", 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
Comment