Originariamente inviato da wiulma
ti ringrazio,
ma a me serve creare un file .xls e salvarlo su disco.
inoltre, aprendolo solo nel browser ho riscontrato alcune difficoltà nell'impostare per esempio le proprietà delle celle (tipo di dato contenuto) e per questo sono stato costretto a creare un file
Perchè questo che cosa fa?:
codice:
<%
response.buffer = true
response.ContentType = "application/vnd.ms-excel"
response.AddHeader "content-disposition", "inline; filename=esempio.xls"
response.write "<table width=240>"
response.write "<tr>"
for i = 1 to 5
response.write "<td width=40>"
response.write i + i
response.write "</td>"
next
response.write "<td width=40>=Somma(A1:E1)</td>"
response.write "</tr>"
response.write "</table>"
response.flush
response.end
%>
oppure:
codice:
<%
Dim FileName
FileName="Vista.xsl"
Response.Buffer = true
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename=" & FileName
path="../db/Listino.mdb"
Dim DBConn
Set DBConn=Server.CreateObject("ADODB.Connection")
Dim rs
set rs=Server.CreateObject("ADODB.Recordset")
strConn="Provider = Microsoft.Jet.OLEDB.4.0;"
strConn= strConn & "Data Source =" & Server.MapPath(path)
DBConn.Open strConn
Set rs=DBConn.Execute("SELECT TipoProdotto, NomeProdotto, Prezzo FROM Prodotti")
Response.write "<table border=1>"
Response.Write("<tr>")
Response.Write("<th bgcolor='#ff0000'>Tipo Prodotto</th><th bgcolor='#ff0000'>Nome Prodotto</th><th bgcolor='#ff0000'>Prezzo (€)</th></tr>")
Response.write "<tr>"
Response.Write("<td>")
Response.write rs.GetString(,,"</td><td>","</td></tr><tr><td>","")
Response.write "</td></tr></table>"
Set rs=Nothing
DBConn.Close
Set DBConn= Nothing
Response.Write("
Clicca qui per tornare indietro")
Response.flush
Response.end
%>