Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051
October 2008 | Nile Bits

Monthly Archives - October 2008

Export to excel in ASP.NET using C#

In this article we are going to show two examples of exporting to excel. First one is how to export grid view control to excel and the second one is how to export data table to excel. 1-Export Grid View control to Excel: HtmlForm htmlForm = new HtmlForm(); string fileName = "attachment; filename=Reports.xls"; Response.ClearContent(); Response.AddHeader("content-disposition", fileName); Response.ContentType = "application/ms-excel"; StringWriter strw...