View Single Post
Old June 9th, 2004, 02:41 PM   #2 (permalink)
rcotten
 
Join Date: Feb 2004
Posts: 12
rcotten is on a distinguished road
Re: CMS Supervisor auto scripts

Well I'll reply to my own thread so if anyone else comes looking for this info they will have it.

CMS Supervisor uses VBSCRIPT in its .csvauto files.

Here is the script I wrote that will read in a text file line for line and run a CMS report for each agent id. This report points to a Custom CMS report but you can adapt it to point to any others.


'Ray Cotten 6/9/04
'VBSCRIPT to run CMS reports for Accucheck
'Reads 1st line of agents.txt to get date range for report
'Reads the rest of agents.txt into v array
'Run CMS Supervisor report ACC AGENT REPORT for each agent id
'Last line of agents.txt should be 9999 to exit program
'agents.txt should be located in the same directory at this *.cvsauto file
'Use cvs.log in the centervu directory to troubleshoot issues
'
'syntax of agents.txt file should be first line date range all other
'lines agent id's. Last line must equal 9999.
'
'05/01/04-05/31/04
'5359
'5023
'5378
'8055
'9999
'


'Environment variables need to run CMS reports
'LANGUAGE=ENU
'SERVERNAME=YOURCMSSERVER.COM


Public Sub Main()

l=0 'loop value for read loop
i=0 'loop value for printing loop

dim date 'value for date range
dim v(999) 'define array. All data is read into this from agents.txt
dim fs, f 'define filesystem stuff for read

cvsSrv.Reports.ACD = 1

Set Info = cvsSrv.Reports.Reports("Historical\CMS custom\ACC AGENT REPORT")

'Reads file one line at a time into v array

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("agents.txt", 1)
date = f.ReadLine
Do While f.AtEndOfStream <> True
v(l) = f.ReadLine
l=l+1
Loop 'keep reading in data until EOF hit.

f.Close 'close agents.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Print report via CMS Supervisor

Do while v(i) < 9999 'run until last line of agents.txt is 9999
b = cvsSrv.Reports.CreateReport(Info,Rep)


Rep.Window.Top = 4785
Rep.Window.Left = 780
Rep.Window.Width = 18465
Rep.Window.Height = 6885

Rep.SetProperty "Agent",v(i) 'defines agent id to run on

Rep.SetProperty "Dates",date 'defines the date range

b = Rep.PrintReport

Rep.Quit

i=i+1 'add one to count i so we get the next agent id

loop 'keep printing CMS reports


end Sub



Enjoy, :devil:

Ray
rcotten is offline   Reply With Quote