Results 1 to 4 of 4

Thread: emailing a crystal report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113

    emailing a crystal report

    Hi all,
    I have a web (asp) system which generates many crystal reports. One of these crystal reports is a form which is used to submit claims. We need to e-mail this form to various organisations.

    Obviously we cant just email the crystal report as an attachement. Any ideas of the best way I could go about in emailing the reports with their data and format in a file format that is accessible by the masses?

    Thanks
    You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!

  2. #2
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306
    The best way would be to have you program export the Crystal report to a PDF fromated file and then emial it out. Using the craxdrt.dll object in your program will allow you to do this with no problem.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113
    any tips on how to use that object and can it be done with Crystal 8?
    You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!

  4. #4
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306
    I use Crystal 8.5 so I imagin it should work.
    I took this out of code that I use and edited it to leave on the needed code. I quickly did this so I probably left some variables that aren't declared in there or some global variables in there. This should get you in the right direction.

    VB Code:
    1. Public Sub PrintReport_PDF()
    2. On Error GoTo HANDLER
    3. Dim I As Integer
    4.     Dim strSELECTION As String
    5.     Dim ReportForm As Form
    6.     Dim sScreenORPrinted As String
    7.     Dim CApp As Craxdrt.Application
    8.     Dim CReport As CRAXDRT.Report
    9.    
    10.     sScreenORPrinted = PREP    
    11.     Set CApp = New CRAXDRT.Application
    12.     'CHECK WHICH DATABASE WE ARE USING----------------------------
    13.    
    14.     Set CReport = CApp.OpenReport(Location & sScreenORPrinted)
    15.    
    16.    'LOG INTO DATABASE TABLES-------------------------------------
    17.     For I = 1 To CReport.Database.Tables.Count
    18.         CReport.Database.Tables(I).SetLogOnInfo Server, DB, UserID, Password
    19.     Next
    20.     '-------------------------------------------------------------
    21.    
    22.     'SET REPORT PROPERTIES----------------------------------------
    23.     CReport.EnableParameterPrompting = False
    24.     CReport.DiscardSavedData    
    25.        
    26.     CReport.ReadRecords
    27.     CReport.ExportOptions.PDFExportAllPages = False
    28.     CReport.ExportOptions.PDFFirstPageNumber = 1
    29.     CReport.ExportOptions.PDFLastPageNumber = 1
    30.     CReport.ExportOptions.DiskFileName = "g:\PARS\Reports\" & Weeknr(Now()) & "\" & filename  & ".pdf"
    31.     CReport.ExportOptions.DestinationType = crEDTDiskFile
    32.     CReport.ExportOptions.FormatType = crEFTPortableDocFormat
    33.     CReport.Export False
    34.  
    35.     Set CReport = Nothing
    36.        
    37. Exit Sub

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