When creating custom reports or datagrids for web parts and other .Net applications outside of SSRS there is always the need for the user to export the results of the application lists into excel or other external sources.  You can always iterate through your datagrids and output row by row but there is a much easier way that maintains formatting and is much easier to implement.  All you need to do is change the target of your Response from the screen to a file.  To do that in C# see below...
<p style="text-align: left;">Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=outputfilename.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

After that your browse will provide the option to download or open the file providing they have excel installed.