1
Dim crp As New CRAXDRT.Application
Dim rep As CRAXDRT.Report

Set rep = crp.OpenReport(GlbRepPath + "indent_rep.RPT")

rep.ExportOptions.Reset
rep.EnableParameterPrompting = False
rep.DiscardSavedData
rep.ExportOptions.PDFExportAllPages = True

rep.RecordSelectionFormula = "{I_IndentheadT.IND_NO}='" + txtIndentNo.Text + "'"

vFileName = Left(txtIndentNo.Text, 3) + Right(txtIndentNo.Text, 6) + ".pdf"

rep.ExportOptions.DiskFileName = "d:\indent.pdf" 'App.Path & "\" & vFileName

rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat

rep.DisplayProgressDialog = False
rep.Export False 

My code is for converting crystal report to pdf from VB6. The last line gives the error "File Not Found"

1 Answers1

0

Missing file might be some of the files CR uses for PDF export. Check if these files exist:

C:\Program Files (x86)\Common Files\Crystal Decisions\2.0\bin\crtslv.dll
C:\Program Files (x86)\Common Files\Crystal Decisions\2.0\bin\ExportModeller.dll
C:\WINDOWS\Crystal\crxf_pdf.dll
Smith
  • 710
  • 1
  • 7
  • 11
  • Dear Smith,I have to diff computer, one with XP & another with Win10. In both i have Crystal Report 8.5. So i dont have Crystal Decision or Crystal Folder. – Zoher Taher Dec 12 '20 at 08:31
  • I tried with Export True, but same error. – Zoher Taher Dec 12 '20 at 08:42
  • If your code works fine on Win XP and “File Not Found” error pops up on Win 10, copy the entire folder C:\WINDOWS\Crystal from Win XP to Win 10 machine and try pdf export. – Smith Dec 12 '20 at 14:45
  • 1
    Process Monitor is a great tool for troubleshooting various problems. Take a look at https://stackoverflow.com/questions/59463345/distributing-visio-addin-developed-in-vb6/59466130?noredirect=1#comment105141293_59466130 User your application name instead of regsvr32.exe. – Smith Dec 13 '20 at 16:51
  • When i export to pdf from Crystal Report it works, But it does not work from VB code. – Zoher Taher Dec 20 '20 at 08:58