title: Append information to Excel file on GridView Export in ASP.NET C#
body: <p>I'm exporting a GridView to Excel with the following code:</p>
  
  <pre><code>protected void export_OnClick(object sender, EventArgs e)
  {
  
      string style = @"&lt;style&gt; .text { mso-number-format:\@; } &lt;/style&gt; ";
      // Let's hide all unwanted stuffing
      GridView1.AllowPaging = false;
      GridView1.AllowSorting = false;
  
      // Let's bind data to GridView
      BindGrid();
  
      //Change the color back to white
      GridView1.HeaderRow.Style.Add("background-color", "#ffffff");
  
  
      //Apply color to the header
      for (int i = 0; i &lt; GridView1.HeaderRow.Cells.Count; i++)
      {
          GridView1.HeaderRow.Cells[i].Style.Add("background-color", "#e0e0e0");
      }
  
      // Let's output the Gridview
      Response.Clear();
      Response.ContentType = "application/vnd.xls";
      Response.AddHeader("content-disposition", "attachment;filename=" + reportid + ".xls");
  
      StringWriter swriter = new StringWriter();
      HtmlTextWriter hwriter = new HtmlTextWriter(swriter);
  
      GridView1.RenderControl(hwriter);
  
      Response.Write(style);
      Response.Write(swriter.ToString());
      Response.End();
  
  }
  </code></pre>
  
  <p>Now I need to append a Name on the first row, Date &amp; Time on the second row and possibly some other information on the third row. I will also like to leave a row between the actually GridView data and this information. Is this possible? If so, would you be so kind and provide some examples on how can I accomplish this. Thank you.</p>