Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376

    select in fpdf con data

    Salve a tutti mi sono letto quasi tutti i 60 post relativi all'argomento fdpf, ma non sono riuscito a trovare neanche un esempio sul mio problema.
    Ho una select su db access e nella where ho un campo dataConvocazione, la select restituisce 0 record mentre se tolgo la data dal where e lascio gli altri campi tutto funziona regolarmente.
    Inoltre mi piacerebbe inserire nella header un logo, prelevato anche questo da un campo nel db, ma non sono riuscito a capire che cosa e dove inserire all'interno della pagina.
    Grazie della collaborazione
    Qui sotto il codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="fpdf.asp"-->
    <!--#include file="Connections/conn_app.asp" -->
    <!--#include file="Connections/conn.asp" -->
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>

    <%
    Data = request.Form("Dat")
    Categoria = request.Form("Cat")
    Stagione = request.Form("Sta")
    Identificatore = request.Form("P")

    ' Importo la classe JScript in un file VBScript
    Set pdf=CreateJsObject("FPDF")


    ' Inizializzo la classe
    pdf.CreatePDF()


    ' Imposta il percorso della directory contenente i fonts,
    ' le estensioni ed i modelli
    pdf.SetPath("fpdf/")


    ' Imposto il font da utilizzare (Arial), lo style (I = Corsivo)
    ' e la dimensione (10)
    pdf.SetFont "Arial","I",28


    ' Creo un nuovo documento PDF
    pdf.Open()

    ' Aggiungo una pagina al documento PDF
    pdf.AddPage()


    'pdf.SetCreationDate Now() ' data creazione del documento (puoi inserire anche l'ora)
    pdf.SetDisplayMode "real" ' modalità di apertura del documento (real = 100%)
    pdf.SetTextColor 0,0,0

    dim rs1
    Set rs1 = Server.CreateObject("adodb.recordset")
    rs1.ActiveConnection = MM_conn_STRING
    rs1.source = "SELECT * FROM T_Convocazioni WHERE Stagione='" & Stagione &"' and Categoria='" & Categoria & "' and DataConvocazione=#" & Data & "# and Convocato='" & 1 & "'"
    rs1.CursorType = 0
    rs1.CursorLocation = 3
    rs1.LockType = 3
    rs1.Open()


    if not rs1.eof then
    rs1.movefirst
    while not rs1.eof
    n = rs1.fields.item("Nome").value
    c = rs1.fields.item("Cognome").value
    x=pdf.GetX()
    y=pdf.GetY()
    pdf.SetXY 100,100
    'pdf.Cell 0,0, n
    pdf.Cell 0,0, rs1.recordcount
    pdf.SetXY x,y+25
    pdf.Cell 0,0, c
    'FINE LOOP RIGHE
    rs1.movenext
    pdf.SetXY x+6,y
    'pdf.addpage()
    wend
    else
    end if
    ' Chiudo il documento
    pdf.Close()


    ' SE LO VOLESSI SALVARE REALMENTE
    'filewrite=server.mappath("public/pdf.pdf")
    dim percorso
    filewrite=server.mappath("public/pdf.pdf")
    pdf.Output(filewrite)


    percorso = "public/pdf.pdf"
    Response.Redirect(percorso)
    ' Stampo il documento
    'pdf.Output()


    %>
    </BODY>
    </HTML>
    <%
    response.flush()
    %>
    Ultima modifica di devil946; 03-12-2015 a 18:04
    Chi Crede in Me non Perirà MAI

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Forse dipende da come viene compilata la data nel form... prova ad inserirla con il formato standard YYYY-MM-DD
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    grazie ho provato e funzia.
    Adesso gli altri problemi.
    Come faccio a mettere il nome su una cella e su quella a fianco il cognome
    e ppi nella riga successiva la stessa cosa. In pratica:
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME
    NOME COGNOME

    E come faccio ad inserire il logo nella header?

    Grazie
    Chi Crede in Me non Perirà MAI

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    Nessuno che mi dia una mano, sono veramente nel fango!!
    Vi prego è gradito anche codice già sviluppato
    Chi Crede in Me non Perirà MAI

  5. #5
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    risolto. grazie lo stesso
    Chi Crede in Me non Perirà MAI

  6. #6
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    592
    Quote Originariamente inviata da devil946 Visualizza il messaggio
    Nessuno che mi dia una mano, sono veramente nel fango!!
    Vi prego è gradito anche codice già sviluppato
    Se ti stamp il codice di uno dei file ASP che ho scritto per un mercatino, lo riesci a usare per risolvere il tuo problema?
    [code]
    <!-- #include file="fpdf.asp" -->
    <!-- #include file="Connessioni.asp" -->
    <%
    public gdif,perciva, przesposto,przconcordato, importoprovv
    perciva=22
    dim filename, filewrite, testo(66), riga, codiceiva, pagina,przesp, przconc, impiva,RTotale,ITotale
    dim codiceanagrafico, ti(20),nome, cognome, codicefiscale, domicilio, cap,citta,provincia,email,luogonascita, provincianascita,dataloc, DataDeposito,totale,importo,DataNascita,impprov,ri cavo
    dim qtavenduta, DataVendita,Provvigione,Rimborso,Ptotale,Data1,Dat a2,dt1,dt2
    dim label(10), Sconto60, Sconto90, prezzo,prezzovendita

    Data1=request.QueryString("Data1")
    Data2=request.QueryString("Data2")

    dt1="#" & mid(Data1,4,2) & "/" & left(Data1,2) & "/" & right(Data1,4)&"#"
    dt2="#" & mid(Data2,4,2) & "/" & left(Data2,2) & "/" & right(Data2,4)&"#"

    SQL="select * from Configurazione where pk=1"
    RS.Open SQL, conn, 3, 3
    if not RS.EOF then
    label(1)=" " & trim(RS("ragionesociale"))
    label(2)=" " & trim(RS("indirizzo"))
    label(3)=" " & RS("cap") & " " & trim(RS("citta")) & " (" & RS("provincia") & ")"
    citta = trim(RS("citta"))
    label(4)=" P. IVA " & RS("partitaiva")
    label(5)=" TEL. " & RS("telefono")
    dataloc=trim(RS("citta")) & ", " &fmtDate(now)
    label(6)=trim(RS("email"))
    end if
    RS.Close

    filewrite=server.mappath("public/Inventario.pdf")
    filename="public/Inventario.pdf"
    SQL="SELECT * FROM OGGETTIDEPOSITATI WHERE QTAGIACENTE > 0 ORDER BY CODOGGETTO ASC;"

    RS.Open SQL, conn, 3, 3

    Set pdf=CreateJsObject("FPDF")
    pdf.CreatePDF()
    pdf.SetPath("fpdf/")
    pdf.SetMargins 10, 10, 4
    pdf.SetFont "courier","B",10

    pdf.Open()
    pdf.AddPage()
    Intestazione
    Testata
    ITotale=0
    RTotale=0
    pdf.SetFont "courier","",9
    riga = 50

    StampaOggetti riga

    pdf.SetFont "courier","B",10
    riga = riga + 4
    WR string(51," ")&string(40,"_"), riga
    riga = riga + 6
    WR string(20," ")&" Importo totale valore concordato " & FNU(RTotale,12), riga
    riga = riga + 6
    WR string(20," ")&" Importo totale valore (con IVA) " & FNU(ITotale,12), riga
    'pdf.Output()
    pdf.Output(filewrite)
    pdf.Close()

    set pdf=nothing
    %>
    <!-- #include file="Variabili.asp" -->
    <!-- #include file="Disconnessioni.asp" -->
    <%
    response.redirect "VisualizzaPDF2.asp?filename="&filename
    '
    ' inizio sub e funzioni
    sub Testata()

    pdf.SetFont "Arial","B",8
    pdf.SetXY 30, 34
    pdf.Write 10, "Elenco oggetti con qta > 0"

    pdf.SetXY 130, 30
    pdf.Write 10, "Data St: " & fmtDate(now)
    pdf.SetFont "courier","B",8
    testo(1)=" codice descrizione" & string(40," ")&"q.tà prz conc. prz esp."
    WR testo(1), 40
    'WR string(160,"-"),64
    pdf.Line 05, 48, 200,48

    pdf.SetFont "Arial","",8
    pdf.Image "images/logo_Usa_e_Riusa.jpg",155,05,40
    end sub


    sub StampaOggetti( riga)

    totale=0.0
    if not RS.EOF then
    do until RS.EOF
    codogg = RS("CODOGGETTO")
    DataDeposito=LeggiDataOggettoDepositato(codogg)
    provv=RS("PROVV")
    przesp = RS("PREZZO")
    qtapre = RS("QTAGIACENTE")
    prezzo = RS("PREZZOCONCORDATO")

    ITotale=ITotale + przesp * qtapre
    RTotale=RTotale + prezzo * qtapre


    WR right("00000000"&codogg,8) & " " & left(ucase(RS("DESCRIZIONE"))&space(40),40) &" " & right(" "&formatNumber(qtapre,0),8) & " " & FNU(prezzo,8) & " " & FNU(przesp,8) , riga - 4
    riga = riga + 4
    if riga>280 then
    pdf.AddPage()
    pagina=pagina + 1
    Testata
    pdf.SetFont "courier","",9
    riga = 50
    end if

    RS.movenext
    loop
    else

    end if

    RS.Close

    end sub
    '
    sub Intestazione()
    pdf.SetFont "Arial","B",12
    'ragione sociale
    pdf.SetXY 5, 5
    pdf.Write 10, left(label(1),30)

    pdf.SetFont "Arial","",12
    ' email
    pdf.SetXY 65, 5
    pdf.Write 10, label(6)

    'indirizzo
    pdf.SetXY 05, 9
    pdf.Write 10, left(label(2),40)

    ' telefono
    pdf.SetXY 65, 9
    pdf.Write 10, left(label(5),50)

    'citta o comune
    pdf.SetXY 05, 13
    pdf.Write 10, label(3)

    'P.IVA
    pdf.SetFont "Arial","B",10
    pdf.SetXY 05, 17
    pdf.Write 10, label(4)

    'pdf.SetLineWidth 1
    pdf.Line 05, 26, 200, 26

    end sub


    function LeggiDataOggettoDepositato(codogg)
    SQL2="select * from OggettiDepositati where CODOGGETTO =" & codogg & ";"
    RS2.Open SQL2, conn, 3, 3
    if not RS2.EOF then
    LeggiDataOggettoDepositato=RS2("DataDeposito")
    else
    LeggiDataOggettoDepositato=now ' eccezione per evitare errori
    end if
    RS2.Close
    end function

    function FNU(NUM,SIZ)
    FNU=right(space(SIZ)&formatNumber(NUM,2),SIZ)
    end function

    function fmtdate(dt)
    if isDate(dt) then
    fmtDate=right("00" & day(dt),2)&"/"&right("00" & month(dt),2)&"/"&right("0000" & year(dt),4)
    else
    fmtDate="-"
    end if
    end function


    sub WR(dati, Y)
    pdf.SetXY 05, Y
    pdf.Cell 200,10, dati
    end sub
    [/quote]

    vedi se c'è qualcosa che fa al caso tuo nelle istruzioni che ho usato per questo report...
    ciao
    Vic53

  7. #7
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    ok grazie della risposta ma avevo già risolto, comunque ho preso altre info che non avevo implementato ancora.
    Adesso il mio problema è quello che al salto pagina mi duplica solamente la prima riga e poi mette tutte le altre regolarmente.
    Po sto il codice così se sai dirmi dove sbaglio:
    if not rs.eof then
    conta = 1
    pdf.SetXY 55,20
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "REPORT PRESENZE"


    pdf.SetFont "Arial","",10


    pdf.SetXY 30,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "NOME : " & rs("Nome")


    pdf.SetXY 70,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "COGNOME : " & rs("Cognome")


    pdf.SetXY 115,35
    pdf.setfillcolor 255,255,255
    if mesin = "1" then mesin = "GENNAIO" end if
    if mesin = "2" then mesin = "FEBBRAIO" end if
    if mesin = "3" then mesin = "MARZO" end if
    if mesin = "4" then mesin = "APRILE" end if
    if mesin = "5" then mesin = "MAGGIO" end if
    if mesin = "6" then mesin = "GIUGNO" end if
    if mesin = "7" then mesin = "LUGLIO" end if
    if mesin = "8" then mesin = "AGOSTO" end if
    if mesin = "9" then mesin = "SETTEMBRE" end if
    if mesin = "10" then mesin = "OTTOBRE" end if
    if mesin = "11" then mesin = "NOVEMBRE" end if
    if mesin = "12" then mesin = "DICEMBRE" end if


    pdf.Cell 0,0, "DA : " & mesin


    pdf.SetXY 150,35
    pdf.setfillcolor 255,255,255
    if mesfin = "1" then mesfin = "GENNAIO" end if
    if mesfin = "2" then mesfin = "FEBBRAIO" end if
    if mesfin = "3" then mesfin = "MARZO" end if
    if mesfin = "4" then mesfin = "APRILE" end if
    if mesfin = "5" then mesfin = "MAGGIO" end if
    if mesfin = "6" then mesfin = "GIUGNO" end if
    if mesfin = "7" then mesfin = "LUGLIO" end if
    if mesfin = "8" then mesfin = "AGOSTO" end if
    if mesfin = "9" then mesfin = "SETTEMBRE" end if
    if mesfin = "10" then mesfin = "OTTOBRE" end if
    if mesfin = "11" then mesfin = "NOVEMBRE" end if
    if mesfin = "12" then mesfin = "DICEMBRE" end if


    pdf.Cell 0,0, "A : " & mesfin


    pdf.rect 36,50,140,230
    pdf.SetXY 40,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "RILEVATO IL"


    pdf.SetXY 67,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AING"
    x=pdf.getX()


    pdf.SetXY 84,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "M"
    x=pdf.getX()


    pdf.SetXY 94,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AG"
    x=pdf.getX()


    pdf.SetXY 105,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AS"
    x=pdf.getX()


    pdf.SetXY 118,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "A"
    x=pdf.getX()


    pdf.SetXY 127,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AINF"
    x=pdf.getX()


    pdf.SetXY 140,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "P"
    x=pdf.getX()


    pdf.SetXY 150,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "G"
    x=pdf.getX()


    pdf.SetXY 158,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "PINF"


    'SPAZIO DALLA FINE DELLA RIGA PRECEDENTE
    pdf.Ln(10)


    'imposto la nuova coordinata
    pdf.SetXY 40,65


    x=40
    y=65


    while not rs.eof


    if conta > 29 then
    if not rs.eof then
    pdf.addpage()
    pdf.SetXY 15,10
    x=pdf.GetX()
    y=pdf.GetY()
    pdf.Image logo,x,y,40

    'conta = 1
    pdf.SetXY 55,20
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "REPORT PRESENZE"

    pdf.SetFont "Arial","",10

    pdf.SetXY 30,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "NOME : " & rs("Nome")

    pdf.SetXY 70,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "COGNOME : " & rs("Cognome")

    pdf.SetXY 115,35
    pdf.setfillcolor 255,255,255
    if mesin = "1" then mesin = "GENNAIO" end if
    if mesin = "2" then mesin = "FEBBRAIO" end if
    if mesin = "3" then mesin = "MARZO" end if
    if mesin = "4" then mesin = "APRILE" end if
    if mesin = "5" then mesin = "MAGGIO" end if
    if mesin = "6" then mesin = "GIUGNO" end if
    if mesin = "7" then mesin = "LUGLIO" end if
    if mesin = "8" then mesin = "AGOSTO" end if
    if mesin = "9" then mesin = "SETTEMBRE" end if
    if mesin = "10" then mesin = "OTTOBRE" end if
    if mesin = "11" then mesin = "NOVEMBRE" end if
    if mesin = "12" then mesin = "DICEMBRE" end if

    pdf.Cell 0,0, "DA : " & mesin

    pdf.SetXY 150,35
    pdf.setfillcolor 255,255,255
    if mesfin = "1" then mesfin = "GENNAIO" end if
    if mesfin = "2" then mesfin = "FEBBRAIO" end if
    if mesfin = "3" then mesfin = "MARZO" end if
    if mesfin = "4" then mesfin = "APRILE" end if
    if mesfin = "5" then mesfin = "MAGGIO" end if
    if mesfin = "6" then mesfin = "GIUGNO" end if
    if mesfin = "7" then mesfin = "LUGLIO" end if
    if mesfin = "8" then mesfin = "AGOSTO" end if
    if mesfin = "9" then mesfin = "SETTEMBRE" end if
    if mesfin = "10" then mesfin = "OTTOBRE" end if
    if mesfin = "11" then mesfin = "NOVEMBRE" end if
    if mesfin = "12" then mesfin = "DICEMBRE" end if

    pdf.Cell 0,0, "A : " & mesfin

    pdf.rect 36,50,140,230
    pdf.SetXY 40,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "RILEVATO IL"

    pdf.SetXY 67,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AING"
    x=pdf.getX()

    pdf.SetXY 84,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "M"
    x=pdf.getX()

    pdf.SetXY 94,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AG"
    x=pdf.getX()

    pdf.SetXY 105,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AS"
    x=pdf.getX()

    pdf.SetXY 118,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "A"
    x=pdf.getX()

    pdf.SetXY 127,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AINF"
    x=pdf.getX()

    pdf.SetXY 140,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "P"
    x=pdf.getX()

    pdf.SetXY 150,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "G"
    x=pdf.getX()

    pdf.SetXY 158,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "PINF"

    'SPAZIO DALLA FINE DELLA RIGA PRECEDENTE
    pdf.Ln(10)

    'imposto la nuova coordinata
    pdf.SetX 40
    e = rs("DataInsert")
    Giorno = mid(e,1,2)
    Mese = mid(e,4,2)
    Anno = mid(e,7,4)
    DataItalia = Giorno&"/"&Mese&"/"&Anno
    x=pdf.getX()
    y=pdf.getY()
    pdf.Cell 0,0, DataItalia
    if rs("AING") = 1 then pdf.image"images\ok.jpg",x+30,y,5
    if rs("M") = 1 then pdf.image"images\ok.jpg",x+44,y,5
    if rs("AG") = 1 then pdf.image"images\ok.jpg",x+55,y,5
    if rs("AScuola") = 1 then pdf.image"images\ok.jpg",x+66,y,5
    if rs("A") = 1 then pdf.image"images\ok.jpg",x+78,y,5
    if rs("AINF") = 1 then pdf.image"images\ok.jpg",x+89,y,5
    if rs("P") = 1 then pdf.image "images\ok.jpg",x+100,y,5
    if rs("G") = 1 then pdf.image "images\ok.jpg",x+110,y,5
    if rs("PINF") = 1 then pdf.image "images\ok.jpg",x+120,y,5
    pdf.SetY y+7
    y=pdf.GetY(y)
    conta = 1
    end if
    end if
    if not rs.eof then
    'imposto la nuova coordinata
    pdf.SetX 40

    e = rs("DataInsert")
    Giorno = mid(e,1,2)
    Mese = mid(e,4,2)
    Anno = mid(e,7,4)
    DataItalia = Giorno&"/"&Mese&"/"&Anno
    'pdf.SetXY x,y
    pdf.Cell 0,0, DataItalia

    if rs("AING") = 1 then pdf.image"images\ok.jpg",x+30,y,5
    if rs("M") = 1 then pdf.image"images\ok.jpg",x+44,y,5
    if rs("AG") = 1 then pdf.image"images\ok.jpg",x+55,y,5
    if rs("AScuola") = 1 then pdf.image"images\ok.jpg",x+66,y,5
    if rs("A") = 1 then pdf.image"images\ok.jpg",x+78,y,5
    if rs("AINF") = 1 then pdf.image"images\ok.jpg",x+89,y,5
    if rs("P") = 1 then pdf.image "images\ok.jpg",x+100,y,5
    if rs("G") = 1 then pdf.image "images\ok.jpg",x+110,y,5
    if rs("PINF") = 1 then pdf.image "images\ok.jpg",x+120,y,5
    pdf.SetY y+7
    y=pdf.GetY(y)
    conta = conta + 1
    end if
    rs.MoveNext
    wend
    end if


    ' Chiudo il documento
    pdf.Close()
    Chi Crede in Me non Perirà MAI

  8. #8
    Utente di HTML.it L'avatar di vic53
    Registrato dal
    Oct 2010
    residenza
    Fonte Nuova (Roma)
    Messaggi
    592

    Nota su modo di scrivere codice

    Quote Originariamente inviata da devil946 Visualizza il messaggio
    ok grazie della risposta ma avevo già risolto, comunque ho preso altre info che non avevo implementato ancora.
    Adesso il mio problema è quello che al salto pagina mi duplica solamente la prima riga e poi mette tutte le altre regolarmente.
    Po sto il codice così se sai dirmi dove sbaglio:
    if not rs.eof then
    conta = 1
    pdf.SetXY 55,20
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "REPORT PRESENZE"


    pdf.SetFont "Arial","",10


    pdf.SetXY 30,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "NOME : " & rs("Nome")


    pdf.SetXY 70,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "COGNOME : " & rs("Cognome")


    pdf.SetXY 115,35
    pdf.setfillcolor 255,255,255
    if mesin = "1" then mesin = "GENNAIO" end if
    if mesin = "2" then mesin = "FEBBRAIO" end if
    if mesin = "3" then mesin = "MARZO" end if
    if mesin = "4" then mesin = "APRILE" end if
    if mesin = "5" then mesin = "MAGGIO" end if
    if mesin = "6" then mesin = "GIUGNO" end if
    if mesin = "7" then mesin = "LUGLIO" end if
    if mesin = "8" then mesin = "AGOSTO" end if
    if mesin = "9" then mesin = "SETTEMBRE" end if
    if mesin = "10" then mesin = "OTTOBRE" end if
    if mesin = "11" then mesin = "NOVEMBRE" end if
    if mesin = "12" then mesin = "DICEMBRE" end if


    pdf.Cell 0,0, "DA : " & mesin


    pdf.SetXY 150,35
    pdf.setfillcolor 255,255,255
    if mesfin = "1" then mesfin = "GENNAIO" end if
    if mesfin = "2" then mesfin = "FEBBRAIO" end if
    if mesfin = "3" then mesfin = "MARZO" end if
    if mesfin = "4" then mesfin = "APRILE" end if
    if mesfin = "5" then mesfin = "MAGGIO" end if
    if mesfin = "6" then mesfin = "GIUGNO" end if
    if mesfin = "7" then mesfin = "LUGLIO" end if
    if mesfin = "8" then mesfin = "AGOSTO" end if
    if mesfin = "9" then mesfin = "SETTEMBRE" end if
    if mesfin = "10" then mesfin = "OTTOBRE" end if
    if mesfin = "11" then mesfin = "NOVEMBRE" end if
    if mesfin = "12" then mesfin = "DICEMBRE" end if


    pdf.Cell 0,0, "A : " & mesfin


    pdf.rect 36,50,140,230
    pdf.SetXY 40,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "RILEVATO IL"


    pdf.SetXY 67,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AING"
    x=pdf.getX()


    pdf.SetXY 84,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "M"
    x=pdf.getX()


    pdf.SetXY 94,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AG"
    x=pdf.getX()


    pdf.SetXY 105,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AS"
    x=pdf.getX()


    pdf.SetXY 118,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "A"
    x=pdf.getX()


    pdf.SetXY 127,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AINF"
    x=pdf.getX()


    pdf.SetXY 140,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "P"
    x=pdf.getX()


    pdf.SetXY 150,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "G"
    x=pdf.getX()


    pdf.SetXY 158,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "PINF"


    'SPAZIO DALLA FINE DELLA RIGA PRECEDENTE
    pdf.Ln(10)


    'imposto la nuova coordinata
    pdf.SetXY 40,65


    x=40
    y=65


    while not rs.eof


    if conta > 29 then
    if not rs.eof then
    pdf.addpage()
    pdf.SetXY 15,10
    x=pdf.GetX()
    y=pdf.GetY()
    pdf.Image logo,x,y,40

    'conta = 1
    pdf.SetXY 55,20
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "REPORT PRESENZE"

    pdf.SetFont "Arial","",10

    pdf.SetXY 30,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "NOME : " & rs("Nome")

    pdf.SetXY 70,35
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "COGNOME : " & rs("Cognome")

    pdf.SetXY 115,35
    pdf.setfillcolor 255,255,255
    if mesin = "1" then mesin = "GENNAIO" end if
    if mesin = "2" then mesin = "FEBBRAIO" end if
    if mesin = "3" then mesin = "MARZO" end if
    if mesin = "4" then mesin = "APRILE" end if
    if mesin = "5" then mesin = "MAGGIO" end if
    if mesin = "6" then mesin = "GIUGNO" end if
    if mesin = "7" then mesin = "LUGLIO" end if
    if mesin = "8" then mesin = "AGOSTO" end if
    if mesin = "9" then mesin = "SETTEMBRE" end if
    if mesin = "10" then mesin = "OTTOBRE" end if
    if mesin = "11" then mesin = "NOVEMBRE" end if
    if mesin = "12" then mesin = "DICEMBRE" end if

    pdf.Cell 0,0, "DA : " & mesin

    pdf.SetXY 150,35
    pdf.setfillcolor 255,255,255
    if mesfin = "1" then mesfin = "GENNAIO" end if
    if mesfin = "2" then mesfin = "FEBBRAIO" end if
    if mesfin = "3" then mesfin = "MARZO" end if
    if mesfin = "4" then mesfin = "APRILE" end if
    if mesfin = "5" then mesfin = "MAGGIO" end if
    if mesfin = "6" then mesfin = "GIUGNO" end if
    if mesfin = "7" then mesfin = "LUGLIO" end if
    if mesfin = "8" then mesfin = "AGOSTO" end if
    if mesfin = "9" then mesfin = "SETTEMBRE" end if
    if mesfin = "10" then mesfin = "OTTOBRE" end if
    if mesfin = "11" then mesfin = "NOVEMBRE" end if
    if mesfin = "12" then mesfin = "DICEMBRE" end if

    pdf.Cell 0,0, "A : " & mesfin

    pdf.rect 36,50,140,230
    pdf.SetXY 40,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "RILEVATO IL"

    pdf.SetXY 67,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AING"
    x=pdf.getX()

    pdf.SetXY 84,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "M"
    x=pdf.getX()

    pdf.SetXY 94,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AG"
    x=pdf.getX()

    pdf.SetXY 105,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AS"
    x=pdf.getX()

    pdf.SetXY 118,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "A"
    x=pdf.getX()

    pdf.SetXY 127,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "AINF"
    x=pdf.getX()

    pdf.SetXY 140,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "P"
    x=pdf.getX()

    pdf.SetXY 150,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "G"
    x=pdf.getX()

    pdf.SetXY 158,55
    pdf.setfillcolor 255,255,255
    pdf.Cell 0,0, "PINF"

    'SPAZIO DALLA FINE DELLA RIGA PRECEDENTE
    pdf.Ln(10)

    'imposto la nuova coordinata
    pdf.SetX 40
    e = rs("DataInsert")
    Giorno = mid(e,1,2)
    Mese = mid(e,4,2)
    Anno = mid(e,7,4)
    DataItalia = Giorno&"/"&Mese&"/"&Anno
    x=pdf.getX()
    y=pdf.getY()
    pdf.Cell 0,0, DataItalia
    if rs("AING") = 1 then pdf.image"images\ok.jpg",x+30,y,5
    if rs("M") = 1 then pdf.image"images\ok.jpg",x+44,y,5
    if rs("AG") = 1 then pdf.image"images\ok.jpg",x+55,y,5
    if rs("AScuola") = 1 then pdf.image"images\ok.jpg",x+66,y,5
    if rs("A") = 1 then pdf.image"images\ok.jpg",x+78,y,5
    if rs("AINF") = 1 then pdf.image"images\ok.jpg",x+89,y,5
    if rs("P") = 1 then pdf.image "images\ok.jpg",x+100,y,5
    if rs("G") = 1 then pdf.image "images\ok.jpg",x+110,y,5
    if rs("PINF") = 1 then pdf.image "images\ok.jpg",x+120,y,5
    pdf.SetY y+7
    y=pdf.GetY(y)
    conta = 1
    end if
    end if
    if not rs.eof then
    'imposto la nuova coordinata
    pdf.SetX 40

    e = rs("DataInsert")
    Giorno = mid(e,1,2)
    Mese = mid(e,4,2)
    Anno = mid(e,7,4)
    DataItalia = Giorno&"/"&Mese&"/"&Anno
    'pdf.SetXY x,y
    pdf.Cell 0,0, DataItalia

    if rs("AING") = 1 then pdf.image"images\ok.jpg",x+30,y,5
    if rs("M") = 1 then pdf.image"images\ok.jpg",x+44,y,5
    if rs("AG") = 1 then pdf.image"images\ok.jpg",x+55,y,5
    if rs("AScuola") = 1 then pdf.image"images\ok.jpg",x+66,y,5
    if rs("A") = 1 then pdf.image"images\ok.jpg",x+78,y,5
    if rs("AINF") = 1 then pdf.image"images\ok.jpg",x+89,y,5
    if rs("P") = 1 then pdf.image "images\ok.jpg",x+100,y,5
    if rs("G") = 1 then pdf.image "images\ok.jpg",x+110,y,5
    if rs("PINF") = 1 then pdf.image "images\ok.jpg",x+120,y,5
    pdf.SetY y+7
    y=pdf.GetY(y)
    conta = conta + 1
    end if
    rs.MoveNext
    wend
    end if


    ' Chiudo il documento
    pdf.Close()
    So che ognuno è libero di scrivere il codice come meglio puo, pero ti posso dire una cosa (solo per aiutarti)
    io ho lavorato 30 anni in programmazione e ora sono in pensione... ma un suggerimento mi permetto di dartelo:
    utilizza la struttura nella programmazionme e usa lil codice indentato...perchè è fondamentale per seguire il flusso del programma
    di solito si usa un main con chiamate a sottoprocedure in cui la struttura viene notevolmente migliorata e si puo controllare quello che deve fare il programma.

    non voglio fare il bacchettone ma per seguire la logica del tuo script vado in pallone...

    Esempio dove devi scrivere una riga di stampa costruisci una sub e sposta lasoutine alla fine dello script...
    il main di un report alla fine si riduce a questo

    **** tipo programma ***
    inizializzazioni varie
    1. testata
    2. stampa riga report fino alla fine del recordset
    se finisce lo spazio righe della pagina
    3.
    footer totali
    aggiungi una pagina
    resetti in contatore righa stampa
    testata
    stampa riga report

    a fine programma
    esegui il footer se la riga e maggiore di 1 altrimenti il footer lo hai gia stampato
    nella ultima pagina che hai stampato ma di questo devi fare il debugging per verificare il tutto.

    Spero di non averti annoiato ... buon lavoro


    ciao
    Vic53

  9. #9
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    Giustissimo, ma quando uno è abituato a fare in un certo modo, anche se sbagliato o incasinato agli occhi altrui, cambiare non è facile soprattutto in corsa. Non puoi proprio aiutarmi?
    Chi Crede in Me non Perirà MAI

  10. #10
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    376
    nessuno che mi dia un valido aiutino?
    Chi Crede in Me non Perirà MAI

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.