Ciao come posso esportare una tabella in excel?
Ho usato questo codice ma con esito negativo...:
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.AddHeader("content-disposition",String.Format("attachment; filename={0}", "pippo"))
HttpContext.Current.Response.ContentType = "application/ms-excel"
Using sw As New StringWriter()
Using htw As New HtmlTextWriter(sw)
' Create a form to contain the grid
tabella.RenderControl(htw)
' render the htmlwriter into the response
HttpContext.Current.Response.Write(sw.ToString())
HttpContext.Current.Response.[End]()
nel senso che mi viene creato un file excel con il seguente contrenuto:
<table border="0">
</table>
grazie

Rispondi quotando