SHARE
TWEET

CrystalReports Export PDF

a guest May 2nd, 2014 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim oApp, oRpt  
  2. vFilenameReport = UCase("C:\Customer Folders\Report Location\CrystalReport.rpt")
  3. vFilenameExport = UCase("C:\Customer Folders\Output Destination\CrystalExport.pdf")
  4.   Set oApp =CreateObject("CrystalRuntime.Application")  
  5.   Set oRpt = oApp.OpenReport(vFilenameReport, 1)  
  6.   oRpt.DisplayProgressDialog = False  
  7.   oRpt.MorePrintEngineErrorMessages = False  
  8.   oRpt.EnableParameterPrompting = False  
  9.   oRpt.DiscardSavedData
  10.   Set dbproperties = oRpt.Database.Tables.Item(1).ConnectionProperties
  11.   dbproperties("User ID") = "DATABASE_USER"
  12.   dbproperties("Password") = "DATABASE_PASS"  
  13.   oRpt.ExportOptions.DiskFileName = vFilenameExport  
  14.   oRpt.ExportOptions.FormatType = 31                  '31=>PDF  
  15.  oRpt.ExportOptions.DestinationType = 1              '1=>filesystem  
  16.  oRpt.ExportOptions.PDFExportAllPages = True  
  17.   oRpt.Export(False)
RAW Paste Data
Top