I am using ListView to display report data with different colours for each item in listview. Then i am export listview data to excel file.
Data is comming correctly. But, i want to see same colours of listview rows in excel file also. I want to know is their any code to change the colour of excel rows
HOW TO CHANGE COLOUR
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VasanthRank #1,487 · 1.1K reputationPosted Mar 30, 2010, 10:10 PM EDT
string FileName = "";
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" expExcel.xls "");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter oWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(oWriter);
Table.RenderControl(htmlWrite);
Response.Write(oWriter.ToString());
Response.End();
If you're facing any error in Response.End (while debug ) , please check my forum to resolve the same in http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=82416
If it helps you , please mark as answer.