Geeks With Blogs
IDeploy adventures of a geek without a parachute June 2005 Entries
Export a data grid to excel...

 Send a datagrid to the browser in excel format.....

 

Response.ContentType = "application/vnd.ms-excel"
        Response.Charset = ""
        Response.Clear()
        Me.EnableViewState = False
        Dim sw As New StringWriter()
        Dim hw As New HtmlTextWriter(sw)
        Me.DataGrid1.RenderControl(hw)
        Response.Write(sw)
        Response.End()

Posted On Wednesday, June 22, 2005 1:11 PM

Copyright © Scott G. | Powered by: GeeksWithBlogs.net