This Way:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:Panel runat="server" ID="Panel1">
<table>
<tr>
<td>
<asp:Image ID="Image1" ImageUrl="http://www.aspforums.net/Avatars/Azim.png?635213634366300000"
runat="server" />
</td>
</tr>
</table>
<br />
<asp:GridView ID="GridView1" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
RowStyle-BackColor="#A1DCF2" AlternatingRowStyle-BackColor="White" AlternatingRowStyle-ForeColor="#000"
runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Item" HeaderText="Item" ItemStyle-Width="100px" />
<asp:BoundField DataField="Price" HeaderText="Price" ItemStyle-Width="100px" />
</Columns>
</asp:GridView>
</asp:Panel>
<br />
<asp:Button ID="btnExport" runat="server" Text="Export" OnClick="Export" />
</form>
</body>
</html>
C#:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Item"), new DataColumn("Price") });
dt.Rows.Add("Shirt", 199);
dt.Rows.Add("Football", 020);
dt.Rows.Add("Shirt", 566);
dt.Rows.Add("Disc", 099);
dt.Rows.Add("Watch", 54);
dt.Rows.Add("Clock", 890);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void Export(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=Export.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw);
Panel1.RenderControl(hw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
}
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
}
You must have to upload your logo to any site use imgur.com or http://imageshack.com/ for this. It will throw an error if you use image from project directory.
Image

Thank You.