Hi,
I have been trying without success for a couple of months now to email
a Crystal Report in PDF format using the built in functionality, but
all I ever get is a file named "untitled.txt" as an attachment. This is actually a PDF file with a txt extension, and if you change the extension, it loads up just fine.
I've been through all the KBs on the Business Objects site, had a support conversation (until the ticket got closed on me).
Anyone else had the same problem Any good solutions (Currently I have
resorted to saving the file locally and manually creating a MAPI
message and attaching it - pretty ugly stuff really.
Thanks in advance.
Richard

Emailing crystal reports (VS2005 + CR10)
Leon Mayne
Have anyone found a solution to this issue Is it possible to rename the attachment
Thanks,
Frisco
Anatolik
Please let me know.
Thanks,
JB..
Toby Leduc
So far I have only been able to get this to work through an SMTP server like MS Exchange Server, but one work-around is to use the System.Net.Mail.MailMessage object. First create a CR report and export it in PDF format to a temporary file on disk, then send the file (named "reportFileName.pdf" in the following code snippet) in a MailMessage instance as an attachment:
// Use client SMTP Server to send the notification e-mail messages
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(CurrentUser.emailAddress, emailAddresses);
message.Subject = "aiRows[0].ActionID + " Action Plan";
message.Body = "See attached Action Plan " + qar.FormNumber;
message.Attachments.Add(new System.Net.Mail.Attachment(reportFileName, System.Net.Mime.MediaTypeNames.Application.Pdf));
try {
}
catch {
}
finally {
}
As I said this works, but only with an instance of SmtpClient created with a valid SMTP server name (or corresponding IP address). Does anybody know how to use a local mail client, like MS Outlook, as an SMTP server for the SmtpClient class
Mitchell
Chandu Sujay
We have the same problem, but have a partial work-around (which I will post in the next reply). In case somebody can finally offer insight on how to fix the basic problem what follows is a description of how we would like to handle email reports through CR10 in VS2005:
We are using CR for .NET with VS 2005 developing an application that needs to export PDF versions of reports as email attachments. While it works the problem we have is that the attachment is always named "untitled.txt". The attachment actually is a PDF - renaming the extension to "pdf" allows Adobe Reader to open and display the report just fine. Here is the code used to export the report:
CrystalDecisions.Shared.PdfRtfWordFormatOptions pdfOpts =
CrystalDecisions.Shared.ExportOptions.CreatePdfRtfWordFormat Options();
CrystalDecisions.Shared.MicrosoftMailDestinationOptions mailOpts =
CrystalDecisions.Shared.ExportOptions.CreateMicrosoftMailDes tinationOptions();
CrystalDecisions.Shared.ExportOptions exportOpts = new CrystalDecisions.Shared.ExportOptions();
pdfOpts.UsePageRange = false;
exportOpts.ExportFormatOptions = pdfOpts;
mailOpts.MailMessage = "See attached Action Plan for " + qar.FormNumber;
mailOpts.MailSubject = aiRows[0].ActionID + " Action Plan";
mailOpts.MailToList = emailAddresses;
exportOpts.ExportDestinationOptions = mailOpts;
exportOpts.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.MicrosoftMail;
exportOpts.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
report.Export(exportOpts);
What can we do to supply a meaningful name for the attached file, and ensure it bears the correct "pdf" extension
Thanks,
Mitchell
NeederOfVBHelp
noooooooooooooooooooo. I tought I would find an answer over here.
I got the exact same problem here. I dont know how to change the name of the attachment that is send by email from Crystal Report Destination Options things
God. Well, lets continue googling...........
Good luck