|
-
Mar 9th, 2004, 07:31 AM
#1
Thread Starter
Lively Member
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!
-
Mar 9th, 2004, 08:51 AM
#2
Hyperactive Member
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.
-
Mar 15th, 2004, 01:34 AM
#3
Thread Starter
Lively Member
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!
-
Mar 15th, 2004, 10:06 AM
#4
Hyperactive Member
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:
Public Sub PrintReport_PDF()
On Error GoTo HANDLER
Dim I As Integer
Dim strSELECTION As String
Dim ReportForm As Form
Dim sScreenORPrinted As String
Dim CApp As Craxdrt.Application
Dim CReport As CRAXDRT.Report
sScreenORPrinted = PREP
Set CApp = New CRAXDRT.Application
'CHECK WHICH DATABASE WE ARE USING----------------------------
Set CReport = CApp.OpenReport(Location & sScreenORPrinted)
'LOG INTO DATABASE TABLES-------------------------------------
For I = 1 To CReport.Database.Tables.Count
CReport.Database.Tables(I).SetLogOnInfo Server, DB, UserID, Password
Next
'-------------------------------------------------------------
'SET REPORT PROPERTIES----------------------------------------
CReport.EnableParameterPrompting = False
CReport.DiscardSavedData
CReport.ReadRecords
CReport.ExportOptions.PDFExportAllPages = False
CReport.ExportOptions.PDFFirstPageNumber = 1
CReport.ExportOptions.PDFLastPageNumber = 1
CReport.ExportOptions.DiskFileName = "g:\PARS\Reports\" & Weeknr(Now()) & "\" & filename & ".pdf"
CReport.ExportOptions.DestinationType = crEDTDiskFile
CReport.ExportOptions.FormatType = crEFTPortableDocFormat
CReport.Export False
Set CReport = Nothing
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|