RESOLVED --> Error while exporting a crystal report
I am getting the following error when trying to export a crystal report to PDF format.
Run-time error '-2147190908 (80047784)'
Failed to export the report
It works fine on my machine, but the error occurs when running on clients machine. I know the problem isn't with the code but with some .dll file.
Code:
Crystal.ReportFileName = strPath & "Quote.rpt"
Crystal.DataFiles(0) = strPath & "QuoteSystem.mdb"
Crystal.SelectionFormula = "{Quote.QuoteNo} = " & cboQuoteNo.Text
Crystal.PrintFileName = QuoteLocation & ".rpt"
Crystal.PrintFileType = crptCrystal
Crystal.Destination = crptToFile
Crystal.PrintReport
Dim CRXApplication As Object, CRXReport As Object, _
CRXExportOptions As Object
Set CRXApplication = CreateObject("CrystalRuntime.Application")
Set CRXReport = CRXApplication.OpenReport(Crystal.PrintFileName)
Set CRXExportOptions = CRXReport.ExportOptions
CRXExportOptions.FormatType = crEFTPortableDocFormat
CRXExportOptions.DestinationType = crEDTDiskFile
CRXExportOptions.DiskFileName = Left(Crystal.PrintFileName, Len(Crystal.PrintFileName) - 3) & "pdf"
CRXReport.DisplayProgressDialog = False
CRXReport.Export False
Set CRXExportOptions = Nothing
Set CRXReport = Nothing
Set CRXApplication = Nothing
rsQuoteHdr!FileLocation = Left(Crystal.PrintFileName, Len(Crystal.PrintFileName) - 3)
rsQuoteHdr.Update
lbLoc.Caption = rsQuoteHdr!FileLocation
Kill Crystal.PrintFileName