Monday, May 12, 2008

export data in excel in single sheet

protected void exporttoexcel_Click(object sender, EventArgs e)


Response.Buffer = true;

Response.ContentType = "application/";

Response.ContentEncoding = System.Text.Encoding.UTF7;

Response.AddHeader("Content-Disposition", "attachment;filename=report.xls");

Response.Charset = "";

this.EnableViewState = false;

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);





1 comment :

  1. This is not working when i handling large
    volume of data.
    Would you pls give me any advise.


AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath