MikeMcKeown
Programmer
Hi,
I would like to export the files created by activeX script to be automatically saved to a predetermined location on the execution of a DTS package. I have checked the code using Visual Basic compiler and seems to work.
When I put it into DTS package - the code executes however the file is not in the predeteemined location. Export Code is shown below:-
I was therefore wondering do I somehow have to create a connection to Crystal and if so what type of connection do I use?
Const crEFTWordForWindows = 14
Const crEDTDiskFile = 1
Set Conn = CreateObject("ADODB.Connection")
Set Comm = CreateObject("ADODB.Command")
Set Rcdset = CreateObject("ADODB.Recordset")
Conn.Open "Provider=SQLOLEDB.1;Initial Catalog=Audit_Database;App=Crystal Export;Data Source=(local)", "**", "****"
'You're database connection
Comm.ActiveConnection = Conn
Comm.CommandText = "SELECT * from final_reports_last_generated"
Set Rcdset = Comm.Execute
Set App = CreateObject("CrystalRuntime.application.8.5") '
Set Report = App.OpenReport("Z:\report1.rpt")
report.ExportOptions.DestinationType = crEDTDiskFile
report.ExportOptions.FormatType = crEFTWordForWindows
report.ExportOptions.DiskFileName = "C:\TEST\diditwork.rtf"
Thanks
I would like to export the files created by activeX script to be automatically saved to a predetermined location on the execution of a DTS package. I have checked the code using Visual Basic compiler and seems to work.
When I put it into DTS package - the code executes however the file is not in the predeteemined location. Export Code is shown below:-
I was therefore wondering do I somehow have to create a connection to Crystal and if so what type of connection do I use?
Const crEFTWordForWindows = 14
Const crEDTDiskFile = 1
Set Conn = CreateObject("ADODB.Connection")
Set Comm = CreateObject("ADODB.Command")
Set Rcdset = CreateObject("ADODB.Recordset")
Conn.Open "Provider=SQLOLEDB.1;Initial Catalog=Audit_Database;App=Crystal Export;Data Source=(local)", "**", "****"
'You're database connection
Comm.ActiveConnection = Conn
Comm.CommandText = "SELECT * from final_reports_last_generated"
Set Rcdset = Comm.Execute
Set App = CreateObject("CrystalRuntime.application.8.5") '
Set Report = App.OpenReport("Z:\report1.rpt")
report.ExportOptions.DestinationType = crEDTDiskFile
report.ExportOptions.FormatType = crEFTWordForWindows
report.ExportOptions.DiskFileName = "C:\TEST\diditwork.rtf"
Thanks