Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Sending document stream pdf by email ?
posted

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 MemoryStream
Report.Publish(ReportStream, FileFormat.PDF)
' create new email message then..
msg.Attachments.Add(New Attachment(ReportStream, "myfile.pdf"))

is it some kind of encoding issue?