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

DTS with Crystal Report - Export

Status
Not open for further replies.

MikeMcKeown

Programmer
Apr 1, 2003
69
GB
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 have got it working, no need to create a connection just needed;-

Report.Export False

meaning no user interaction
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top