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

    passaggio da browser a excel

    Ciao a tutti, mettiamo che ho un carrello di prodotti ordinati in un recordset con tutti i dati (prelevati da un db access) e volessi prelevare la tabella che stampo in html per elaborarla con excel... come dovrei fare?
    "Link2me.it: Professional network e Marketplace"
    www.link2me.it

  2. #2
    scrivi un file .csv

  3. #3
    mi dici come?
    "Link2me.it: Professional network e Marketplace"
    www.link2me.it

  4. #4

  5. #5
    Comma Separated Value e cioè database in excel con campi separati da
    una virgola per esempio

  6. #6
    scusate ma mi mancano le basi

    esempio pratico?
    "Link2me.it: Professional network e Marketplace"
    www.link2me.it

  7. #7
    non sai lavorare con i file di testo? mai usato FSO?

  8. #8
    l'ho usato per cancellare file, mai per crearli... mi sai dare qualche dritta?
    "Link2me.it: Professional network e Marketplace"
    www.link2me.it

  9. #9
    Questo è un esempio che ho trovato un po' di tempo fa su internet; non ricordo dove. Crea un file Excel con due celle e con il titolo che gli dai tu + la data (che viene aggiunta in autometico).
    Prova a vedere se può esserti di aiuto in qualche modo.
    codice:
    <html>
    <title>CodeAve.com(Create Excel from User Input)</title>
    <body bgcolor="#FFFFFF">
    <%
    'Check to see if title has been entered or not
    u_title=request.form("u_title")
    if u_title = "" then
    %>
    
    <form method="POST" action="<%= request.servervariables("script_name") %>">
    Document Title
    
    <input type="text" name="u_title" size="35">
    
    
    
    Cell 1
    
    
    <textarea rows="2" name="u_cell1" cols="35"></textarea>
    
    
    
    Cell 2
    
    
    <textarea rows="2" name="u_cell2" cols="35"></textarea>
    <input type="submit" value="Submit" ></p>
    </form>
    </body>
    </html>
    <%
    else
    
    ' If there is a user inputted title
    ' get all of the user inputed values
    u_title=request.form("u_title")
    u_cell1=request.form("u_cell1")
    u_cell2=request.form("u_cell2")
    
    ' Varible created fo excel file name. Speces are changed to underscores
    ' and later the current date is added in attempts to create a unique file
    ' Users are not prevented from entering characters !@#$%^&*()+= that are 
    ' invlaid file names in this example
    g_filename=replace(u_title," ","_")
    
    
    set fso = createobject("scripting.filesystemobject")
    '   create the text (xls) file to the server adding the -mmddyyyy after the g_title value
    Set act = fso.CreateTextFile(server.mappath(""&g_filename & "-"& month(date())& day(date())& year(date()) &".xls"), true)
    
    '   write all of the user input to the text (xls) document    
    '   The .xls extension can just as easily be .asp or .inc whatever best suits your needs
    '   Providing that you remove the info contained in the header and remove the xml
    '   reference in the html tag that starts the page/excel file.  It is to add gridlines and
    '   a title to the excel worksheet
    act.WriteLine "<html xmlns:x=""urn:schemas-microsoft-com:office:excel"">"
    act.WriteLine "<head>"
    act.WriteLine "<!--[if gte mso 9]><xml>"
    act.WriteLine "<x:ExcelWorkbook>"
    act.WriteLine "<x:ExcelWorksheets>"
    act.WriteLine "<x:ExcelWorksheet>"
    act.WriteLine "<x:Name>"& u_title &"</x:Name>"
    act.WriteLine "<x:WorksheetOptions>"
    act.WriteLine "<x:Print>"
    act.WriteLine "<x:ValidPrinterInfo/>"
    act.WriteLine "</x:Print>"
    act.WriteLine "</x:WorksheetOptions>"
    act.WriteLine "</x:ExcelWorksheet>"
    act.WriteLine "</x:ExcelWorksheets>"
    act.WriteLine "</x:ExcelWorkbook>"
    act.WriteLine "</xml>"
    act.WriteLine "<![endif]--> "
    act.WriteLine "</head>"
    act.WriteLine "<body>"
    act.WriteLine "<table>"
    act.WriteLine "<tr>"
    act.WriteLine "<td>"
    act.WriteLine u_cell1
    act.WriteLine "</td>"
    act.WriteLine "<td>"
    act.WriteLine u_cell2
    act.WriteLine "</td>"
    act.WriteLine "</tr>"
    act.WriteLine "</table>"
    act.WriteLine "</body>"
    act.WriteLine "</html>"
    ' close the document 
    act.close
    %>
    Your excel has been successfully create and can be viewed by clicking 
    .xls" target="_blank">here
    <%
    end if
    %></body></html>
    Salvalo come create_excel.asp (ad esempio) e provalo così com'è.

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.