| Author: mvenkatesan 19 Nov 2008 | Member Level: Gold | Rating:  Points: 6 |
Hi use this code for export dgrid to excel Regards Venkatesan.M
Imports System Imports System.IO Imports System.Text Imports System.Data Imports System.Runtime.InteropServices.Marshal
Private Sub lnkExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkExport.Click Dim tw As New System.IO.StringWriter Dim hw As New System.Web.UI.HtmlTextWriter(tw) Response.Clear() Response.AddHeader("content-disposition", "attachment;filename=Export1.xls") Response.Charset = "" Response.ContentType = "application/vnd.xls" dgdReviews.RenderControl(hw) Response.Write(tw.ToString()) Response.End() End Sub
|