Hello -
I'm having problems with a function to export out a report to a Fax function
on exchange. I think the code works fine if the user has the GFI Faxmaker
client installed, my problem is that even tho I have if Err goto.... in the
function, i'm getting a runtime -2147190908(80047784) Failed to export the
report on the line of code "Report.Export(False)"
I don't understand why it won't let the error handler take control.... after
you click on ok it pops you out of the application.. So in case i have a
user that doesn't have the client installed - i still don't want them to be
booted. Below is my code - any help would be greatly appreciated!!!
Private Sub cmdFAXQuote_Click()
Set crystal = New CRAXDRT.Application 'MANAGES REPORTS
Set report = crystal.OpenReport(App.Path & "\Customerquote.rpt") 'OPEN
OUR REPORT
On Err GoTo ErrorHandler
For Each objTable In report.Database.Tables
objTable.SetLogOnInfo "[SQL LOGIN INFO]"
Next
report.RecordSelectionFormula = "{Quote_Main.QuoteID} = " &
AdoQuote.Recordset.Fields("QuoteID").Value
report.DiscardSavedData 'CLEARS REPORT SO WE WORK FROM RECORDSET
report.ExportOptions.DestinationType = crEDTEMailMAPI
report.ExportOptions.FormatType = crEFTPortableDocFormat
report.ExportOptions.PDFExportAllPages = True
report.ExportOptions.MailToList = "[fax:1" &
adoCustInfo.Recordset.Fields("Fax") & "]"
report.ExportOptions.MailSubject = "Polymer Packaging Quote"
Dim ret As String
report.Export(False)
AdoQuote.Recordset.Fields("datecomplete") = Format(Now(), "mm/dd/yyyy")
AdoQuote.Recordset.Update
GoTo reportend
ErrorHandler:
MsgBox Err.Description & vbCrLf & Err.Number & " Source: " & Err.Source,
vbExclamation, "Error Occured"
Call App.LogEvent(Err.Description & " Number: " & Err.Number & " Source:
" & Err.Source, vbLogEventTypeError)
Err.Clear
reportend:
Set crystal = Nothing
Set report = Nothing
End Sub