Emailing Crystal Reports

  • Thread starter Thread starter DBM
  • Start date Start date
D

DBM

Can somebody please direct me some sample code or a off the shelf control to
help me understand what I need to do to email a Crystal Report? I want to
email from the report itself if possible.

Thanks.

Brad
 
DBM,

Email from the report itself is just pushing the button showed in the
created report on screen.

If you want it direct from your program you have to know what version you
use.
In version 2003 there was no streaming in the SMTP interface.

Cor
 
Can somebody please direct me some sample code or a off the shelf control
to help me understand what I need to do to email a Crystal Report? I want
to email from the report itself if possible.


this code works but two things: (a) it generates the Outlook security
waraning when it runs, and (b) the attachment sent in the email is title
"untitled.txt" ... if you rename the attachment to PDF extension, it opens
as a PDF; I just haven't figure out yet how to spcify the name of the
attachment ... or get around the Outlook security warning .. maybe you can
solve those issues and report back.


PdfRtfWordFormatOptions pdfOpts =
ExportOptions.CreatePdfRtfWordFormatOptions();
MicrosoftMailDestinationOptions mailOptions =
ExportOptions.CreateMicrosoftMailDestinationOptions();
ExportOptions exportOpts = new ExportOptions();

pdfOpts.UsePageRange = false;
exportOpts.ExportFormatOptions = pdfOpts;


mailOptions.MailMessage = "My Report is enclosed";
mailOptions.MailSubject = "Crystal Mail";
mailOptions.MailToList = "(e-mail address removed)"
mailOptions.UserName = "userName";
mailOptions.Password = "password";

exportOpts.ExportDestinationOptions = mailOptions;
exportOpts.ExportDestinationType = ExportDestinationType.MicrosoftMail;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;

register.Export(exportOpts);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top