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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change the CMS daily output .xls file name/date

Status
Not open for further replies.

RickHorn

Technical User
Apr 14, 2010
11
US
I have a daily CMS auto script that works great as long as I move the file before the next day. Does anyone know how to change the .acsauto script so that a date will be added to the end of the file name of a daily .xls file so it will create a new file daily instead of overwritting the previous file?
 

This is the best I could come up with:


In your script there should be a line that looks like this:

b = Rep.ExportData("C:\[path]\filename.txt"), 44, 1, True, True, True)

You can change this to:

b = Rep.ExportData("C:\[path]\filename "&FormatDateTime(date(), 1)&".txt"), 44, 1, True, True, True)

This will give you a file name today of:

filename Wednesday, April 21, 2010.txt




- Stinney

Quoting only proves you know how to cut and paste.
 
I tried adding that string Stinney but now the report isn't printing at all. I'll double check to make sure I didn't miss anything. I also had to change one of my fields from Rep.SaveHTML to Rep.ExportData. That may have something to do with it because I used the save html option to expot the data and changed the extension to .xls to have it save in excel. I'mnot sure what the difference is between the teo but I'm trying everything.
 

Can you post the script?

- Stinney

Quoting only proves you know how to cut and paste.
 
'LANGUAGE=ENU
'SERVERNAME=<server ip>
Public Sub Main()

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: Local Interval: Save HTML"
'## Parameters.Add "Report: Historical: Designer: Local Interval: Save HTML","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "1","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\Local Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "315","_Top"
'## Parameters.Add "2505","_Left"
'## Parameters.Add "12225","_Width"
'## Parameters.Add "13140","_Height"
'## Parameters.Add "The report Historical\Designer\Local Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "22;24","Trunk Groups"
'## Parameters.Add "-1","Dates"
'## Parameters.Add "00:00-23:30","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\user\Desktop\Daily Reports\Local Interval.xls","_Output"
'## Parameters.Add "","_Template"
'## Parameters.Add "True","_UseFonts"

On Error Resume Next

cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\Local Interval")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\Local Interval was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\Local Interval was not found on ACD 1."
Set Log = Nothing
End If
Else

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

Rep.Window.Top = 315
Rep.Window.Left = 2505
Rep.Window.Width = 12225
Rep.Window.Height = 13140



Rep.SetProperty "Trunk Groups","22;24"

Rep.SetProperty "Dates","-1"

Rep.SetProperty "Times","00:00-23:30"




b = Rep.ExportData("C:\Documents and Settings\user\Desktop\Local Interval " &FormatDateTime(date(), 1)&".txt"), 44, 1, 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
 
Here is my original script -

'LANGUAGE=ENU
'SERVERNAME=<server ip>
Public Sub Main()

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: Local Interval: Save HTML"
'## Parameters.Add "Report: Historical: Designer: Local Interval: Save HTML","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "1","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\Local Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "315","_Top"
'## Parameters.Add "2505","_Left"
'## Parameters.Add "12225","_Width"
'## Parameters.Add "13140","_Height"
'## Parameters.Add "The report Historical\Designer\Local Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "22;24","Trunk Groups"
'## Parameters.Add "-1","Dates"
'## Parameters.Add "00:00-23:30","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\user\Desktop\Daily Reports\Local Interval.xls","_Output"
'## Parameters.Add "","_Template"
'## Parameters.Add "True","_UseFonts"

On Error Resume Next

cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\Local Interval")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\Local Interval was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\Local Interval was not found on ACD 1."
Set Log = Nothing
End If
Else

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

Rep.Window.Top = 315
Rep.Window.Left = 2505
Rep.Window.Width = 12225
Rep.Window.Height = 13140



Rep.SetProperty "Trunk Groups","22;24"

Rep.SetProperty "Dates","-1"

Rep.SetProperty "Times","00:00-23:30"




b = Rep.SaveHTML("C:\Documents and Settings\user\Desktop\Daily Reports\Local Interval.xls", 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
 
My original script save a very clean .xls report which is nice and all I want to do is add the date on the end but I think the Rep.ExportData info may not work with the Rep.SaveHTML which is why I changed it to exportdata but it still didn't work.
 

I created a script and changed the save to HTML with the same inserted code and it worked for me.

b = Rep.SaveHTML("C:\[path]\filname " &FormatDateTime(date(), 1)&".HTML", True, "")

- Stinney

Quoting only proves you know how to cut and paste.
 
Stinney I got busy so I couldn't try it yesterday but I will try it tomorrow and let you know how it worked.

Thanks
 
Stinney I added your date script to my Rep.SaveHTML and it works great. Thanks a lot. One more question if you don't mind. Since my reports print the previous days info do you know how to make the date script show the previous days date instead of the current day? I tried changing the 1 to a -1 and the script wouldn't run so I know it's not as easy as that.

Thanks
 

It really should be that simple.

But I'm a little confused, the scripts you posted above show -1 in the date:

Rep.SetProperty "Dates","-1"

This should be running the report for the previous day.


- Stinney

Quoting only proves you know how to cut and paste.
 
You're correct Stinney. The report info in the file is correct but the file name isn't. (i.e. report info is from 4/22/10 but the file name has the "report name Friday April 23, 2010") is there a way to adjust the date script for the file name output to show the previous days date so even though I ran the report today the 23rd the file output will have the 22nd's date to match the data in the files date?
 

Ah, gotcha. Yup, just add a -1 after the date():

b = Rep.SaveHTML("C:\[path]\filname " &FormatDateTime(date()-1, 1)&".HTML", True, "")

- Stinney

Quoting only proves you know how to cut and paste.
 
That worked!!! Man I litterally put a -1 in every space within that date area except there. I really appreciate all of your help. If you need any assistance let me know. I have 9 years of AVAYA experience and if I don't know it I usually can find it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top