Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avaya CMS Script Output Filename to Include Report Runtime

Status
Not open for further replies.

Colinjr017

IS-IT--Management
Nov 20, 2013
5
GB
Hi

Does anyone know how to do this please. I am running CMS Supervisor Client R16 and an acsauto script for a real time report. I can get my output filename to include the date but not the time. The Function FormatDateTime only seems to work when a value of 1 is used, which gives me a valid filename with date, but I want time in there. When I use a value of 3 (or any of the other values 0, 2,3 or 4) it does not work. The key line seems to be the 'b =' towards the bottom.

Below is a copy of my script contents:

'LANGUAGE=ENU
'SERVERNAME=10.45.1.200
Public Sub Main()

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Real-Time: Designer: 1. crTrunk Group Real Time Capacity V3: Export Data"
'## Parameters.Add "Report: Real-Time: Designer: 1. crTrunk Group Real Time Capacity V3: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Real-Time\Designer\1. crTrunk Group Real Time Capacity V3","_Report"
'## Parameters.Add "2","_ACD"
'## Parameters.Add "720","_Top"
'## Parameters.Add "7875","_Left"
'## Parameters.Add "5565","_Width"
'## Parameters.Add "11715","_Height"
'## Parameters.Add "default","_TimeZone"
'## Parameters.Add "The report Real-Time\Designer\1 crTrunk Group Real Time Capacity was not found on ACD 2.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "101-158","Trunk Group"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "P:\CMS Scripts\Export Test1.txt","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "True","_DurSecs"

On Error Resume Next

cvsSrv.Reports.ACD = 2
Set Info = cvsSrv.Reports.Reports("Real-Time\Designer\1. crTrunk Group Real Time Capacity V3")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Real-Time\Designer\1 crTrunk Group Real Time Capacity was not found on ACD 2.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Real-Time\Designer\1 crTrunk Group Real Time Capacity was not found on ACD 2."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.Window.Top = 720
Rep.Window.Left = 7875
Rep.Window.Width = 5565
Rep.Window.Height = 11715


Rep.TimeZone = "default"



Rep.SetProperty "Trunk Group","101-158"




b = Rep.ExportData("P:\CMS Scripts\Export Test1 "&FormatDateTime(date(), 1)&".xls", 9, 0, True, True, True)





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

If anyone can help, it would be really appreciated !!

Colin
 

This issue is that the date/time format includes characters that you can't use as a file name.

You will need to change the date/time to just numbers like 112320131324 for 11/23/2013 13:24

Before On Error Resume Next add the line:

Dim dtvar, tvar, dvar, fnvar


Before the file save line: b = Rep.ExportData add:

dtvar = Now

dvar = right("0"&month(dtvar),2)&right("0"&day(dtvar),2)&year(dtvar)
tvar = right("0"&Hour(dtvar),2)&right("0"&Minute(dtvar),2)
fnvar = dvar&tvar


Change your file save line to:

b = Rep.ExportData("P:\CMS Scripts\Export Test1 "&fnvar&".xls", 9, 0, True, True, True)


- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
From this I understand that the file output will display as "Textname"120620131326.xls

Is it possible to have it round up the time? i.e) If the recorded time was 9:03, It would round it up to 9:15 or round down to 9:00?

If possible, would it be just some simple If statements? Or is there a built-in function to do so?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top