-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: RajHariVichuKarthi
Message 1 in Discussion
Hi,
My scenario is:Datagrid export to word
My code:
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrint.Click
'Remove the charset from the Content-Type header.
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-Word"
Response.Charset = ""
Me.EnableViewState = False
Try
Dim stringWrite As New System.IO.StringWriter
Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)
'dgViewMyQuestions.Controls.Clear()
dgViewMyQuestions.RenderControl(htmlWrite)
Dim strHTML As String = stringWrite.ToString()
With HttpContext.Current
'send to doc
Response.AddHeader("Content-Disposition", "inline;
filename=Report.doc")
Response.Write(strHTML)
Response.Close()
Response.End()
End With
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
i am getting the error "Thread was being aborted Exception". But
"strHTML" contains the records,its not writing in the word doc. instead of
the records,it is writing the above exception error.
Any one know about this...!? help me.
Regards
S.Rajesh
_________________________________________________________________
Protect your PC from viruses. Get in the experts.
http://www.msn.co.in/pcsafety/ Click here now!
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]