how can i send emial of crystal repot like exporting to report
Printable View
how can i send emial of crystal repot like exporting to report
There would be a couple of steps involved here.
Saveing the file to disk
Attaching it to an email message
Are you familiar with saving a report file to disk?
Do you have code that programmtically creates and sends an email message?
Are you looking for one of these or both of them?
The Crystal runtime library has the ability to Export a report into several formats and to then Email that file.
Code:With objReport.ExportOptions
.FormatType = crEFTPortableDocFormat
.DestinationType = crEDTEMailMAPI
.MailSubject = "Testing"
.MailToList = "some_email_address"
.MailMessage = "Hello World"
End With
objReport.DisplayProgressDialog = False
objReport.Export False
Like Export Report button in Crystal Viewer . I want a button for Email Report and after the selection the report will send a attachedment to the given email id.
Hi
Email is sending properly but the report converted to .pdf is not done .It send attachment as untitled.txt instead of untitled.pdf
Pls guide how to solve this problem..
1. File name should be given as crystal report name
2. Export to .PDF should be proper
Code:Dim ExportOptions As New ExportOptions
Dim EMailOptions As New MicrosoftMailDestinationOptions
Try
ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
ExportOptions.ExportDestinationType = ExportDestinationType.MicrosoftMail
EMailOptions.MailToList = txtEmailId.Text
EMailOptions.MailSubject = "Company Detail Information"
EMailOptions.MailMessage = "The Company Detail Information Report is Attached in PDF format"
ExportOptions.ExportDestinationOptions = EMailOptions
CrReport.Export(ExportOptions)
Catch ex As Exception
MsgBox(ex.Message)
End Try