J
jonefer
If I want to export an Excel from a gridview
I normally use these two procedures... but I get a render error perhaps due
to the fact that this particular gridview is on a panel triggered by a modal
popup extender:
What should I modify or add?
'this line is to help the Export to Excel control
Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As
Control)
End Sub
Protected Sub cmdExcelExport_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdExcelExport.Click
Response.Clear()
Response.AddHeader("content-disposition",
"attachment;filename=FileName.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New
HtmlTextWriter(stringWrite)
gvActionList.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
End Sub
I normally use these two procedures... but I get a render error perhaps due
to the fact that this particular gridview is on a panel triggered by a modal
popup extender:
What should I modify or add?
'this line is to help the Export to Excel control
Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As
Control)
End Sub
Protected Sub cmdExcelExport_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdExcelExport.Click
Response.Clear()
Response.AddHeader("content-disposition",
"attachment;filename=FileName.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New
HtmlTextWriter(stringWrite)
gvActionList.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
End Sub