Hola amigos estoy haciendo una aplicación y me gustaría saber si existe algún metodo con el cual se pueda exportar una Grid a Excel
Gracias..
Saludos
| | |||
| |||
|
__________________ Buena Vida... Francisco |
| | |||
| |||
| ¡Hola! Esto te podrá ayudar...
Código:
Private Sub btnGeneraExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGeneraExcel.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=NombreArchivo.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
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)
gridMov.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
End Sub
__________________ "No nos atrevemos a muchas cosas porque son difíciles, pero son difíciles porque no nos atrevemos a hacerlas" :si: Séneca |
| | ||||
| ||||
| He usado este control, con buenos resultados http://www.codeproject.com/aspnet/Ex...assLibrary.asp Saludos |