We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trying to Stream DocIO MailMerge to Client

Thread ID:





105178 Sep 14,2012 07:01 PM UTC Sep 17,2012 06:45 AM UTC ASP.NET Web Forms (Classic) 1
Tags: DocIO
Timothy Ventura
Asked On September 14, 2012 07:01 PM UTC

I need to stream DocIO to the client as an attachment.  Was trying to use this method:

doc.Save("certificate.doc", FormatType.Doc, HttpContext.Current.Response, HttpContentDisposition.Attachment)

but it causes an aborted thread error because it's being called from within an update panel.

Now trying to use the other overload and save to memorystream instead and the good 'ol Response.BinaryWrite(bytes) a byte array method, but it's not working.  Below is what I have, but it isn't working, although I have used this method in the past with other products with no problems.  Any help would be greatly appreciated.


Dim Certificates As New System.IO.MemoryStream
doc.MailMerge.ExecuteNestedGroup(_ds, _commands)
doc.Save(Certificates, FormatType.Doc)
Dim bytes = New Byte(CType(Certificates.Length, Integer)) {}
Certificates.Read(bytes, 0, CInt(Certificates.Length))

      HttpContext.Current.Response.Buffer = True
      HttpContext.Current.Response.Charset = ""
      HttpContext.Current.Response.ContentType = "application/ms-word"
      HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filenname=certificates.doc")

Ramkumar M [Syncfusion]
Replied On September 17, 2012 06:45 AM UTC

Hi Timothy,

Thank you for your interest in Syncfusion products.

We have created a sample to meet your requirement of stream document to client side while called from updated panel. Please find the sample from the below link and let us know if this helps you.

Sample Link:


In this Sample:

We have used PostBackTrigger Class defines a control inside a UpdatePanel control as a postback control. For more information on PostBackTrigger Class please refer the below link


Please let us know if you have any questions.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon