Results 1 to 8 of 8

Thread: generate report, save pdf without user intervention or viewing

  1. #1
    Hyperactive Member
    Join Date
    Apr 02
    Location
    Georgia
    Posts
    337

    generate report, save pdf without user intervention or viewing

    I currently have a Crystal Report 8.5 using the Dev edition inside my VB6 application that I use a form with the crviewer to run, there are a few paramaters I pass with code.

    My boss as an additional request now wants to generate the report,save as pdf, and mail it using MAPI along with other attachments without the user ever seeing the actual report in the viewer. I can handle the other attachments I just don't know how to generate the Crystal Report input the paramaters save etc without the user seeing it and without any user intervention.

    Any suggestions as to how to do this would be appreciated.

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    May 01
    Posts
    306
    I to am intersted in finding this out.....

    If i figure it out I'll let you know, and please do the same if you find out how.

    thanks

  3. #3
    Hyperactive Member
    Join Date
    Apr 02
    Location
    Georgia
    Posts
    337
    I will be glad to share the answer with you if I can ever get this figured out.

  4. #4
    Hyperactive Member
    Join Date
    May 01
    Posts
    306
    Figured it out

    you need to add the Crystal Reports 8.5 ActiveX Designer Run Time Library

    [Highlight=VB]
    Private Sub Command1_Click()
    Dim appl As New CRAXDRT.Application
    Dim rep As CRAXDRT.Report

    Set rep = appl.OpenReport("c:\temp\Promising Prospects Summary (NS).rpt", 1)
    rep.ExportOptions.DiskFileName = "c:\temp\pdf_report.pdf"
    rep.ExportOptions.DestinationType = crEDTDiskFile
    rep.ExportOptions.FormatType = crEFTPortableDocFormat
    rep.Export False

    End Sub


    [\vbcode]

  5. #5
    Hyperactive Member
    Join Date
    Apr 02
    Location
    Georgia
    Posts
    337
    Thanks scostell

    I will give that a try, looks like it should work fine.

    Thanks again

  6. #6
    New Member
    Join Date
    Dec 05
    Posts
    1

    Re: generate report, save pdf without user intervention or viewing

    scostell,

    Thank you very much....I was looking for code to save a crystal report to pdf and you saved me a ton of time.

  7. #7
    Addicted Member
    Join Date
    Mar 02
    Posts
    135

    Re: generate report, save pdf without user intervention or viewing

    Hello scostell , I was searching the forum for Generating PDF files from VB without user intervention and found this thread. Your code helped me and I was able to generate report in PDF. Thank a lot. I am facing two small problems... a. If my database (*.mdb) is password protected then it is not working and giving me and error "Server has not opened." b. If on report I have any formula field, then how to set the values of this field. Thanks,

  8. #8
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,633

    Re: generate report, save pdf without user intervention or viewing

    You could use the ConnectionProperties object to pass the password to the rpt when you load it in the vb6 app
    I can help you more if you post the Datasource properties of the rpt
    In the Crystal reports ide, menu / Database / Set Datasource Location
    Expand the Properties level and post them
    Also post your actual code where you load & export the rpt
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

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