Crystal Report 9 Import to PDF
i m using VB6 with crystal report 9. i wanna import report into PDF. one way is that i view report and press import button then select pdf format from selection combo and save it.. but i dont wanna to view the report. i want user to press command button and report automaticaly save as PDF without opening in viewer. for example file paths are fix, so i dont want user to invlove in paths, pressing import button etc stuff. Thanks
Re: Crystal Report 9 Import to PDF
If you are familiar with the Crystal object libraries it is simply a matter of setting the ExportOptions and calling the Export method. The following is pretty basic but should help get you started.
Code:
Dim crApp As CRAXDRT.Application
Dim crRep As CRAXDRT.Report
Set crApp = New CRAXDRT.Application
Set crRep = crApp.OpenReport("C:\report1.rpt")
crRep.DisplayProgressDialog = False
With crRep.ExportOptions
.FormatType = crEFTPortableDocFormat
.PDFExportAllPages = True
.DestinationType = crEDTDiskFile
.DiskFileName = "C:\Export.pdf"
End With
crRep.Export False