I need to download the data in a table and also a picture to an excel spreadsheet. I am currently able to create the excel spreadsheet on the website, but how do I get the data into the spreadsheet?
protected void btn_ExcelDownload_Click(object sender, EventArgs e)
{
string path = Server.MapPath("");
path = path + @"\Resources\MessageStatus.xlsx";
string name = Path.GetFileName(path);
Response.AppendHeader("content-disposition", "attachment; filename=" + name);
Response.ContentType = "Application/msword";
Response.WriteFile(path);
Response.End();
}
I had done this using this class