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
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