
Originariamente inviata da
devil946
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()