Scripting Monthly CMS Reports

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • crawfos
    Member
    • Jul 2010
    • 7

    Scripting Monthly CMS Reports

    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
  • crawfos
    Member
    • Jul 2010
    • 7

    #2
    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

    Comment

    • shaikht
      Genius
      .
      • Feb 2010
      • 246

      #3
      Hi Crawfos,

      Please involve Avaya Professional Services group if you required any help on scriptings.
      They can suggest you correct method to implement your requirement.

      Comment

      Loading