Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    File excel con più fogli

    Salve a tutti

    io creo un file excel da asp con :

    codice:
    Response.ContentType = "application/vnd.ms-excel"
    Poi lo riempo con una query ciclando su recordset.

    Come posso creare più sheets in questo fiule excel?

    Grazie

  2. #2
    Dov'è il codice che crea il file excel?

  3. #3
    codice:
    <%@LANGUAGE="VBSCRIPT"%>
    <%option explicit%>
    
    
    <%
    Dim Item, mesePreExp, annoPreExp, areaPreExp, strSql, rs
    mesePreExp = trim(request.Form("mesePreExp"))
    annoPreExp = trim(session("AnnoScelto"))
    areaPreExp = trim(request.Form("areaPreExp"))
    
    StrSql = "SELECT * FROM MYTABLE"
    set rs = server.CreateObject("ADODB.recordset")
    rs.Open strSql, objcnn, 3, 3
    
    Dim filename
    filename = "Pianificazione" & UCase(Left(MonthName(mesePreExp), 1)) & LCase(Right(MonthName(mesePreExp), Len(MonthName(mesePreExp)) - 1)) & areaPreExp
    Response.Buffer = True
    Response.ContentType = "application/vnd.ms-excel"
    Response.AddHeader "content-disposition", "inline; filename=" & filename & ".xls"
    Response.Write "<table border='1' bordercolor='#000000'>"
    Response.Write "<tr bgcolor='#999999'>"
    For Each Item in rs.Fields
    Response.Write "<td>"
    	Response.Write Item.Name
    Response.Write "</td>"
    Next
    Do While not rs.Eof
    	Response.Write "<tr nowrap>"
    	For Each Item in rs.Fields
    	Response.Write "<td nowrap>"
    		Response.Write Item.Value
    	Response.Write "</td>"
    	Next
    	Response.Write "</tr>"
    	rs.MoveNext
    Loop
    Response.Write "</table>"
    Response.Flush
    objcnn.Close
    Set objcnn = Nothing
    %>
    Questo è tutto il mio file

  4. #4

  5. #5
    lo sto cercando già da un pò...

    ma non riesco a trovarlo, altrimenti non avrei postato qui sul forum

  6. #6
    Help me!!!


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 © 2026 vBulletin Solutions, Inc. All rights reserved.