audiowizard
IS-IT--Management
Does anybody know how to fix this code to export a Crystal Report to pdf. Thanks
Dim crxApplication As New CRAXDRT.Application
Dim crpt1 As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Dim crxExportOptions As CRAXDRT.ExportOptions
Set crpt1 = crxApplication.OpenReport(App.path & NT40.rpt, 1)
For Each crxDatabaseTable In crpt1.Database.Tables
crxDatabaseTable.Location = "dsn=MS Access 97 Database; UID=Admin; PWD=sq4gcyvt"
Next crxDatabaseTable
crxExportOptions.Reset
Set crxExportOptions = crpt1.ExportOptions
crxExportOptions.DestinationType = crEDTDiskFile
crxExportOptions.FormatType = crEFTPortableDocFormat
crxExportOptions.DiskFileName = App.path & "\" & "NT40.pdf"
crpt1.Export False
Dim crxApplication As New CRAXDRT.Application
Dim crpt1 As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Dim crxExportOptions As CRAXDRT.ExportOptions
Set crpt1 = crxApplication.OpenReport(App.path & NT40.rpt, 1)
For Each crxDatabaseTable In crpt1.Database.Tables
crxDatabaseTable.Location = "dsn=MS Access 97 Database; UID=Admin; PWD=sq4gcyvt"
Next crxDatabaseTable
crxExportOptions.Reset
Set crxExportOptions = crpt1.ExportOptions
crxExportOptions.DestinationType = crEDTDiskFile
crxExportOptions.FormatType = crEFTPortableDocFormat
crxExportOptions.DiskFileName = App.path & "\" & "NT40.pdf"
crpt1.Export False