A
Anniech
I want to export the datagrid to an excel file using htmltextwriter.
My coding are as follows:
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition",
"attachment;filename=xxx.xls;")
Response.Charset = ""
Response.Buffer = False
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
MyGrid.RenderControl(hw)
Response.Write(tw.ToString)
Response.Flush()
Response.Close()
However, when there is a lot of data in the grid, the application gets
error "Server Application Unavailable" on the line
MyGrid.RenderControl(hw).
Is there any size limit on the htmltextwriter? Is there any method to
get around with this problem?
Please help!
Thanks a lot! :roll:
My coding are as follows:
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition",
"attachment;filename=xxx.xls;")
Response.Charset = ""
Response.Buffer = False
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
MyGrid.RenderControl(hw)
Response.Write(tw.ToString)
Response.Flush()
Response.Close()
However, when there is a lot of data in the grid, the application gets
error "Server Application Unavailable" on the line
MyGrid.RenderControl(hw).
Is there any size limit on the htmltextwriter? Is there any method to
get around with this problem?
Please help!
Thanks a lot! :roll: