Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Datagrid to Excel within the VB.NET forums, part of the Software Development category; How to export data from datagrid to excel sheet using VB.NET...
|
|||||||
|
|||
|
Re: Datagrid to Excel
Private sub exportgridview() response.clear() response.addheader("content-disposition", "attachment; filename=filename.xls") response.charset = "" response.contenttype = "application/vnd.ms-excel" dim stringwrite = new system.io.stringwriter() dim htmlwrite = new htmltextwriter(stringwrite) gridview1.rendercontrol(htmlwrite) response.write(stringwrite.tostring()) response.end() gv = nothing end sub public overloads overrides sub verifyrenderinginserverform(byval control as control) ' confirms that an htmlform control is rendered for the 'specified asp.net server control at run time. End sub
|
|
|||
|
Re: Datagrid to Excel
Private sub exportgridview(byval gv as gridview) response.clear() response.addheader("content-disposition", "attachment; filename=filename.xls") response.charset = "" response.contenttype = "application/vnd.ms-excel" dim stringwrite = new system.io.stringwriter() dim htmlwrite = new htmltextwriter(stringwrite) gv.rendercontrol(htmlwrite) response.write(stringwrite.tostring()) response.end() gv = nothing end sub public overloads overrides sub verifyrenderinginserverform(byval control as control) ' confirms that an htmlform control is rendered for the 'specified asp.net server control at run time. End sub
|
|
|||
|
Re: Datagrid to Excel
Private sub exportgridview() response.clear() response.addheader("content-disposition", "attachment; filename=filename.xls") response.charset = "" response.contenttype = "application/vnd.ms-excel" dim stringwrite = new system.io.stringwriter() dim htmlwrite = new htmltextwriter(stringwrite) gridview1.rendercontrol(htmlwrite) response.write(stringwrite.tostring()) response.end() gridview1= nothing end sub public overloads overrides sub verifyrenderinginserverform(byval control as control) ' confirms that an htmlform control is rendered for the 'specified asp.net server control at run time. End sub
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Datagrid | sravee123 | ASP.NET | 1 | 10-08-2008 09:30 AM |
| Adding new row to DataGrid | riswadkarharshad | ASP.NET | 2 | 09-23-2008 03:23 AM |
| Checkbox in Datagrid | Mirunab | C# | 1 | 05-12-2008 03:14 AM |
| Read excel values into script without opening excel | nemishdmehta | QTP | 1 | 02-11-2008 07:19 AM |
| datagrid | glatha | C# | 1 | 06-05-2007 09:50 AM |