Results 1 to 10 of 10

Thread: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    3

    Question Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    Is it possible to export Crystal Reports 8.5 output generated through vb6.0 to PDF format ?
    I have Acrobat Adobe Professional 7.0 installed on my machine.

    Thanks in Advance

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    I do it all the time with Crystal 9. I can't remember if I did it when I was running 8.5. Sorry.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    3

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    Hello Pasvorto:
    Could you post sample code of how you did it in Visual Basic and Crystal Reports 9.0

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    I use a program called CutePDF, which acts like a printer on the system. You can just direct the output to the CutePDF printer, and it will prompt you for a filename to write to.

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

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    This is what I use.

    VB Code:
    1. Private Sub ExportReportToPDF(ReportObject As CRAXDRT.Report, Byval FileName As String, Byval ReportTitle As String)
    2.    
    3.     Dim objExportOptions As CRAXDRT.ExportOptions
    4.  
    5.     ReportObject.ReportTitle = ReportTitle
    6.    
    7.     With ReportObject
    8.         .EnableParameterPrompting = False
    9.         .MorePrintEngineErrorMessages = True
    10.     End With
    11.    
    12.     Set objExportOptions = ReportObject.ExportOptions
    13.    
    14.     With objExportOptions
    15.         .DestinationType = crEDTDiskFile
    16.         .DiskFileName = FileName
    17.         .FormatType = crEFTPortableDocFormat
    18.         .PDFExportAllPages = True
    19.     End With
    20.  
    21.     ReportObject.Export False
    22.  
    23. End Sub
    24.  
    25.  Private Sub Command1_Click()
    26.    
    27.     Dim objCrystal As CRAXDRT.Application
    28.     Dim objReport As CRAXDRT.Report
    29.    
    30.     Set objCrystal = New CRAXDRT.Application
    31.    
    32.     Set objReport = objCrystal.OpenReport(ReportFileName, 1)
    33.     '...code to set report parameters, login information etc...
    34.    
    35.     ExportReportToPDF objReport, "M:\Testing\Beds.pdf", "Beds Held"
    36.  
    37. End Sub

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    3

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    Thanks. I will be testing the code using Crystal Reports 8.5. Hopefully should work.
    I do have the option of printing the pdf files using CutePDF printer module but the pdf files that are generated have different font and file sizes which causes issue when distributing the pdf files to users. (I have already used the CutePDF printer to generate pdf files using Crystal Reports 6.0 programmatically).
    Last edited by AncientCoder; Aug 25th, 2005 at 03:37 PM. Reason: typo error

  7. #7

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    I've had great luck with PDF995. Much the same as CutePDF. Its free with popups, but only costs...get this...$9.95 to get rid of them. It has lots of features, such as auto-saving, if your program is automated.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    Go with Brucevde's code since it is available in CR to directly and freely export to pdf, xls, etc.
    Note: when/if you distribute your app you need to include the dll support files for this. You can look up each file that is needed in the runtime.hlp file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    New Member
    Join Date
    Aug 2006
    Posts
    11

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    hello RobDog888,

    I created a setup for my application. My application requires the use of crystal reports. Sometime I do have to export report files to pdf format. But when I compile those reports I cant export them. I guess I have to include the runtime files in order to be able to export. I referred the run time help and found a couple of files that have to be included in the run time. These are:

    UXFCR.DLL
    UXFDIF.DLL
    UXFDOC.DLL
    WORDDOS.XTD
    Word for DOS
    WPERFECT.XTD
    WordPerfect
    UXFHTML.DLL
    UXFODBC.DLL
    UXFQP.DLL
    UXFREC.DLL
    UXFRTF.DLL
    UXFSEPV.DLL
    UXFTEXT.DLL
    UXFWKS.DLL
    UXFWORDW.DLL
    UXFXLS.DLL
    LF*W.DLL
    LTKRN60W.DLL
    LTFIL60W.DLL

    I wonder if there are any other additional files that have to be included in the set up project...
    Could you please help...
    Thx

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Export to PDF from VB6.0 code & Cyrstal Reports 8.5

    Look at this thread. Download the file in Post #4.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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