below is the code how i export the page to excel file, but the image inside excel is not display after export.
the image is at server directory, /image/logo.jpg , after i download the excel(inside download folder), the image find the path from "C:\Users\user\Downloads\image\logo.jpg" , how can i include the image inside the excel file?
StringWriter strWriter = new StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(strWriter);
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=MyFile.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
i also tried to export to pdf, but failed, mention that the pdf file is corrupted. any advice? code as below
Response.AddHeader("content-disposition", "attachment;filename=MyFile.pdf");
Response.ContentType = "application/pdf";
UPDATE:
i tried few approaches, all return the same result.
the excel file display:
<img src="http://localhost:49524/logo.jpg"/>
instead of the image file itself..