Results 1 to 2 of 2

Thread: Crystal Report 9 Import to PDF

  1. #1

    Thread Starter
    Lively Member Xium's Avatar
    Join Date
    Jan 2007
    Posts
    78

    Question 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
    Hassan Khan

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width