Visualizzazione dei risultati da 1 a 1 su 1

Visualizzazione discussione

  1. #1
    Utente di HTML.it L'avatar di supermac
    Registrato dal
    Jun 2001
    Messaggi
    1,881

    Export immagini in excel

    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)
    Ultima modifica di djciko; 08-11-2019 a 22:30
    W la Ferari effetrenavenave!
    il computer è un somaro veloce! (neanche tanto ndr)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.