![]() ![]() Mail.From = new MailAddress() ĭeliveryMethod = SmtpDeliveryMethod.Network,Ĭredentials = CredentialCache.DefaultNetworkCredentials In case of smtp - This bit is a bit more temperamental. Outlook.MailItem mail = app.CreateItem() as Outlook.MailItem Outlook.TaskItem tsk = (Outlook.TaskItem)app.CreateItem() If (Process.GetProcessesByName("OUTLOOK").Length > 0)Īpp = Marshal.GetActiveObject("Outlook.Application") as Outlook.Application private void button1_Click_1(object sender, EventArgs e) If it is already running, it will use the current instance to do the same, provided both the program and Outlook are running with the same level of privileges. If Outlook is not running, it will open an instance, send the email, then close. I have found a way to do this through both Outlook and smtp. ![]() Msg.Subject = "Crystal Report Attachment " PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions() ĬrDiskFileDestinationOptions.DiskFileName = pdfFile ĬrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile ĬrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat ĬrExportOptions.DestinationOptions = CrDiskFileDestinationOptions ĬrExportOptions.FormatOptions = CrFormatTypeOptions Private void button2_Click(object sender, EventArgs e)ĭiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions() private void button1_Click(object sender, EventArgs e)ĬrystalReportViewer1.ReportSource = cryRpt I'm told that is obsolete, but haven't found anything that works any better, either. Clicking the first button preps what clicking the second button is supposed to send, and yet nothing seems to happen throughout. Any help at all would be greatly appreciated. I realize this is a bit remedial compared to the usual content of Stack, but I haven't much luck getting my feet under me, myself. What I need to know is.where do I even begin with this? I've seen a few questions similar to this, though most involve printing the report, rather than emailing it. I've never created a UFL, I've never worked with Crystal Reports, and I'm fully aware of just how incompatible the disparate versions are, how important it is to sort out precisely which one I'll be working with before being able to finalize any development. I need to create a User Function Library in C#, with Visual Studio 2010, that will allow someone viewing a Report in CR XI to directly send said report as an email. ![]()
0 Comments
Leave a Reply. |