I am still getting the Thread Abort error. I have used a variety of flavors of this. I have also tried the post you suggested. From what I understand the error I get is because I am on a content page and not a regular page.
Code:
Private Sub Export()
Response.Clear()
Response.AddHeader("conten
Response.Charset = ""
' If you want the option to open the Excel file without saving than comment out the line below
' Response.Cache.SetCacheabi
Response.ContentType = "application/vnd.xls" '"application/ms-excel" or "application/vnd.ms-excel"
Dim sw As New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWrit
grdCostRpt.RenderControl(h
Response.Write(sw.ToString
Response.Flush()
Response.End()
End Sub
Public Overloads Overrides Sub VerifyRenderingInServerFor
' Verifies that the control is rendered
End Sub
Main Topics
Browse All Topics





by: carlnorrbomPosted on 2009-11-04 at 22:41:30ID: 25747213
Hi,
g/2007/04/ export_gri dview_to_e xcel_1.htm l
I tend to Use Matt Berseth's approach which I find covers most requirements for exporting gridviews. You can find code and complete instructions on how to use it here:
http://mattberseth.com/blo
/Carl.