Come consigliatomi apro altro thread:
Come faccio col codice seguente a salvare nel file excel le immagini?
("prodotti" è un repeater che contiene foto, testi, prezzi & so on...)
codice:
Protected Sub ExportToExcel(sender As Object, e As EventArgs)
Dim nomefile = "XLS_export"
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=" & nomefile)
Response.Charset = ""
Response.ContentType = "application/vnd.ms-excel"
'Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Using sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
prodotti.RenderControl(hw)
dim stringa = "<html><head><style> .textmode { } </style></head><body>"
stringa &= sw.ToString()
stringa &= "</body></html>"
Response.Output.Write(stringa)
Response.Flush()
Response.End()
End Using
Ho ipotizzato di dover sostituire il path relativo delle immagini con qualcos'altro ma non saprei cosa... il path assoluto delle img sul server? (provo)