Exporting crystal report as PDF and sending via email as attachment - Filename Issue? : Crystal Reports for Visual Studio : Visual Studio : MSDN Forums: "Dim repdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim diskOpts As New CrystalDecisions.Shared.DiskFileDestinationOptions()
Dim ExpOpts As CrystalDecisions.Shared.ExportOptions
Dim MailOpts As New CrystalDecisions.Shared.MicrosoftMailDestinationOptions()
repdoc = Me.CrystalReport11
repdoc.Load('C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplication3\CrystalReport1.rpt')
ExpOpts = repdoc.ExportOptions
With ExpOpts
.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.MicrosoftMail
.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
End With
With MailOpts
.MailMessage = 'Message'
.MailToList = 'enter email adress here'
.MailSubject = 'Attached is a PDF file - .net Export test '
End With
ExpOpts.DestinationOptions = MailOpts
Try
repdoc.Export()
Catch err As Exception
MessageBox.Show(err.ToString())
End Try"