Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 06, 2012 01:35 PM by PGaggar
Dec 06, 2012 04:43 AM|LINK
Please help me in this issue how to freeze panes in export to excel using C# coding,Please find the below Export to excel code.
string attachment = "attachment; filename=Report.xls";
HttpContext.Current.Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
Dec 06, 2012 05:16 AM|LINK
You can't cause the panes to freeze as you are not actually creating an Excel document. You are creating an HTML document with a .xls extension. HTML has no notion of "freezing panes". If you want to use Excel features, you need to generate a real Excel
document by either using Office Interop on the server, or ADO.NET to write to an existing file as if it is a database.
Dec 06, 2012 05:21 AM|LINK
Please provoide me if any code samples for the this issue.
Thanks for your reply...........
Dec 06, 2012 06:43 AM|LINK
Here's an article that discusses using JET to write data to a .xls file:
Dec 06, 2012 01:35 PM|LINK
To generate the xlsx as well as xls file: http://forums.asp.net/p/1863741/5230401.aspx/1?Unable+to+generate+the+xlsx+file+
But i can't help you how to freeze the header column!!!