How do I send a report as PDF via email?
I've used the following to publish a report direct to a webpage..
context.Response.ContentType = "application/pdf"context.Response.AppendHeader("content-disposition", "attachment;filename=myfile.pdf")Report.Publish(context.Response.OutputStream, FileFormat.PDF)But, when I use the following to email the report, the attachment is only 109bytes.
Dim ReportStream As New MemoryStreamReport.Publish(ReportStream, FileFormat.PDF)' create new email message then..msg.Attachments.Add(New Attachment(ReportStream, "myfile.pdf"))is it some kind of encoding issue?
Ah, found it, for some reason I needed to add....
ReportStream.Seek(0, SeekOrigin.Begin)
before attaching it.