Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
DataGrid to Excel new window
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Miguel Ramirez, post: 4261949"] Hello All, When exporting from DataGrid to excel, How can I show excel results in a new window? I have the following code: ------- Protected Sub BExcel_onServerClick(ByVal Sender As Object, ByVal E As EventArgs) Handles BExcel.Click ' Excel Export code Dim strResult As String = Request("ddlExport_Options") ' Set the content type to Excel. Response.ContentType = "application/vnd.ms-excel" ' Remove the charset from the Content-Type header. Response.Charset = "" ' Turn off the view state. Me.EnableViewState = False Dim tw As New System.IO.StringWriter Dim hw As New System.Web.UI.HtmlTextWriter(tw) ' Get the HTML for the control. DGridResults.RenderControl(hw) ' Write the HTML back to the browser. Response.Write(tw.ToString()) ' End the response. Response.End() End Sub I will appreciate any help you can provide. Regards, Miguel. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
DataGrid to Excel new window
Top