Development machine runs on Win2000(sp3) and am working with VB 6.0 and Crystal Report 8.5 (sp2). I have used Crystal Report Viewer control in my form. I was trying to export the report without asking from the user the format and path; but failed cause of this Run Time error.
'*** Code starts from here ***
Dim crApp As New CRAXDDRT.Application
Dim crRep As CRAXDDRT.Report
'Export to disk
' Location of the report
'Set crRep = crApp.OpenReport(App.Path & "\DAILY REPORT.RPT")
Set crRep = CRViewer.ReportSource
crRep.ExportOptions.DestinationType = crEDTDiskFile
'Export to PDF
crRep.ExportOptions.FormatType = crEFTPortableDocFormat
'Export path and file name
crRep.ExportOptions.DiskFileName = "c:\MyReport.pdf"
'Export without displaying the 'Export' dialog box
crRep.Export False '*? This line is generating Run Time Error '-2147190908'
I would really appreciate if someone helps me out.