Visualizzazione dei risultati da 1 a 10 su 12

Hybrid View

  1. #1
    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

  2. #2
    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

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.