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

    Scrivere tabella da asp in word

    ciao a tutti da asp mi creo un file rtf dove all'interno avrei bisogno di inserire una tabella qualcuno mi può aiutare a risolvere questo problema?

  2. #2
    <%
    dim sSQL,xx,rsDa,x
    dim Cr

    Response.Buffer = true //Attivazione del buffer

    // Dichiarazione del tipo documento scelto
    Response.ContentType = "application/msword"

    //Scelta del file su cui scrivere
    Response.AddHeader "Content-Disposition","attachment; filename=Rendiconto-" & month(Date()) & "-" & year(Date()) & "-" & Cr & ".doc"
    sSQL = "Select * from transamm"

    Set rsDa = oADOCon.Execute("ricercagenerica '" & sSQL & "'")
    %>
    <table WIDTH="100%" border = "0"><tr>
    <td>
    <font size="1" face="Arial">
    Rendicontazione dettagli singolo movimento - Comitato Regionale <font></td>
    <td><font size="1" face="Arial">mese n. <%=month(Date())%></font></td>
    </tr>
    </table>
    <table border = "1" font size="1" face="Arial" ><tr>
    <%
    While rsDa.EOF=false
    %>
    <td><%=rsDa("anno")%></td>
    <td><%=rsDa("numero")%></td>
    <td><%=rsDa("NTrans")%></td>
    <td><%=rsDa("Comitato")%></td>
    <td><%=rsDa("IoP")%></td>
    <td><%=rsDa("datatrans")%></td>
    <td><%=rsDa("codice")%></td>
    <td<%=rsDa("verben")%>
    <%
    // Scrittura testo
    Response.Write "</tr>"
    rsDa.Movenext
    Wend
    rsDa.close

    Response.Write "</table>"

    Response.Flush

    Response.End
    %>


    E' un esempio e ti chiede di salvare il file. Prova a mettere a filename un .rtf invece di doc

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.