How about renaming the file after it is created?Code:Private Sub cmdEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEmail.Click Dim ExportOptions As New CrystalDecisions.Shared.ExportOptions Dim EMailOptions As New CrystalDecisions.Shared.MicrosoftMailDestinationOptions Try ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat ExportOptions.ExportDestinationType = ExportDestinationType.MicrosoftMail 'assuming it gets created with the above line. If not, then move these 'two lines as appropriate (and, of course, make sure the path 'is correct Dim myFile As New System.IO.FileInfo("c:\untitled.txt") myFile.MoveTo("c:\report.pdf") EMailOptions.MailToList = txtEmail.Text EMailOptions.MailSubject = "Online Report" EMailOptions.MailMessage = "Report..." ExportOptions.ExportDestinationOptions = EMailOptions CrReport.Export(ExportOptions) Catch ex As Exception MsgBox(ex.Message) End Try End Sub




Reply With Quote