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
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