Click here to Skip to main content
14,878,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
string filename = "FY15 Input Collection Template_" + ddlcity.SelectedItem.Text+".xls" ;
Response.AddHeader("content-disposition", "attachment;filename=" + filename);
Response.Charset = "UTF-8";
Response.ContentType = "application/vnd.ms-excel";
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
Microsoft.Office.Interop.Excel.ApplicationClass _ExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
_ExcelApp.DisplayAlerts = false;
tbcity.RenderControl(hw);
tbannualpercent.RenderControl(hw);
tblasm.RenderControl(hw);
tbtwotable.RenderControl(hw);
tbsectb.RenderControl(hw);
tbthreetb.RenderControl(hw);
tbthirdtb.RenderControl(hw);
tbfourtb.RenderControl(hw);
tbfrtable.RenderControl(hw);
this.EnableViewState = false;
Response.Write(tw.ToString());
Response.Flush();
Response.End();


hai its fine the excel sheet was downloading but my task is to enable only table cells in excel sheet and remainig cells should be freezed like Un-editable please guide me how can i do that..
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900