How to center an Exported image from ASP.net C# to excel?
protected void btnExportExcel_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=file.xls");
Response.ContentType = "application/vnd.ms-excel";
String imagepath = image-source
Response.Output.Write("\n<body>\n<html>");
Response.Output.Write("<table width='800' align='center' style='text-align:center'");
Response.Output.Write("<tr><td colspan='10' align='center'><div align='center' style='text-align:center'>" + imagepath + "</div></td></tr>");
Response.Output.Write("</table>");
Response.Output.Write("\n</body>\n</html>");
Response.Flush();
Response.End();
}