0

I cannot display multiple imagea in one column when export to excel from asp.net. if IsDownload then

Response.ContentType = "application/x-msexcel"
Response.AddHeader "Content-Disposition","attachment; filename=" & StrEncode(FormName,"FILE") & ".xls"
Response.Flush

end if

naychi chit
  • 1
  • 1
  • 1
  • I bet you aren't exporting to Excel. You are sending an HTML or CSV file with a fake extension and deprecated content type. `xls` files are obsolete for over 10 years. Use a libary like EPPlus to create *real* xlsx files – Panagiotis Kanavos Jun 12 '17 at 09:31
  • In any case, you haven't posted any Excel-releated code, so it's impossible to understand what you even mean by `multiple image`. You can't build an `xls` file without Excel itself. The format wasn't documented, unlike `xlsx` which replaced it 10 years ago. If you use a CSV or HTML with an `xls` extension, there's no reason why even a *single* image should appear – Panagiotis Kanavos Jun 12 '17 at 09:34
  • Possible duplicate of [Adding images into Excel using EPPlus](https://stackoverflow.com/questions/11588704/adding-images-into-excel-using-epplus) – Panagiotis Kanavos Jun 12 '17 at 09:35
  • in code, but when export to excel, height works, but width does not work. – naychi chit Jun 12 '17 at 09:39
  • That's HTML, not Excel. You are creating an HTML file that just happens to have a table, and send it with a fake extension and content type. Excel will *detect this* and *try to import it as HTML* using default settings. Build a *real* Excel file instead – Panagiotis Kanavos Jun 12 '17 at 09:41

0 Answers0