Last month a visitor to this forum posted this code. I've tried it out and found Excel opens, but the worksheet is empty. I've never interfaced with Excel from ASP.NET before. Is anyone familiar enough with what this snippet is doing to see what the problem is.
Thanks in advance,
Judy
Thanks in advance,
Judy
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
DataGrid1.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
End Sub