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!

Crystal Report in SQL Server DTS package

Status
Not open for further replies.

DFleisch

MIS
Mar 12, 2003
2
US
I'm having trouble opening a report from an ActiveX task in a DTS package. The code works in VB, but one of the Crystal objects will not enstantiate in VBA. When I run the task/step, DTS complains that the CRAXDRT class is not defined. Has anyone overcome this problem? Here is my code:
Dim craApp ' As New CRAXDRT.Application
Dim craRpt ' As CRAXDRT.Report
set crClass = new CRAXDRT.Application
Set craRpt = craApp.OpenReport(DTSGlobalVariables("pvReport").Value)
craRpt.Database.Tables(1).SetLogOnInfo DTSGlobalVariables("DBA_Source").Value, _
DTSGlobalVariables("DBA_InitialCatalog").Value, _
DTSGlobalVariables("DBA_Username").Value, _
DTSGlobalVariables("DBA_Password").Value
craRpt.ParameterFields.Item(1).AddCurrentValue CDate(DTSGlobalVariables("pvBeginDate").Value)
craRpt.ParameterFields.Item(2).AddCurrentValue CDate(DTSGlobalVariables("pvEndDate").Value)
If DTSGlobalVariables("pvDisplayReport").Value = True Then
craRpt.DisplayProgressDialog = True
craRpt.PrintOut False
Else
craRpt.DisplayProgressDialog = False
End If
craRpt.ExportOptions.PDFExportAllPages = True
craRpt.ExportOptions.DiskFileName = DTSGlobalVariables("pvPDFFilename").Value
craRpt.ExportOptions.DestinationType = crEDTDiskFile
craRpt.ExportOptions.FormatType = crEFTPortableDocFormat
craRpt.Export False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top