Salve,
sto utilizzando il componente asppdf della Persits.
Ho una pagina asp in cui leggo i dati dal mio db e li trasformo in un pdf.
Creo con il componente una tabella con 5 colonne e vorrei quando cambia un codice
stampare una riga con solo 2 celle dove visualizzare la stringa "TOTALE" più l'importo
con un font diverso.
Non so come fare, l'unica cosa che mi riesce è stampare la stringa e l'importo nella seconda e terza cella della tabella.
Come posso fare?
Posto il codice
Grazie
Set PDF = Server.CreateObject("Persits.Pdf")
Set Param = PDF.CreateParam
Set TextParam = PDF.CreateParam
Set Doc = PDF.CreateDocument
Set Font = Doc.Fonts.LoadFromFile("e:\windows\fonts\arial.ttf ")
' Creo una tabella con una riga, e 5 colonne x il dettaglio
Set Table = Doc.CreateTable("width=550; height=20; Rows=1; Cols=5; Border=1; CellSpacing=-1; cellpadding=2 ")
Table.Font = Doc.Fonts("Arial")
Set HeaderRow = Table.Rows(1)
Param.Set("alignment=center")
%>
<FONT STYLE="font-family: Arial; font-size: 12pt; font-weight: bold;">
<%
With HeaderRow
.BGColor = &H90F0FE
.Cells(1).AddText "ORDINE", Param
.Cells(2).AddText "QUANTITA", Param
.Cells(3).AddText "PREZZO", Param
.Cells(4).AddText "PRDODOTTO", Param
.Cells(5).AddText "FUNZIONE", Param
End With
%>
</FONT>
<%
' Imposto la larghezza delle colonne
With Table.Rows(1)
.Cells(1).Width = 50
.Cells(2).Width = 60
.Cells(3).Width = 120
.Cells(4).Width = 200
.Cells(5).Width = 100
End With
param.Set "expand=true" ' expand cell vertically
strfnzrd=""
totprzfnz=0
Do While Not rs.EOF
Set Row = Table.Rows.Add(15) ' row height
param.Add "alignment=center"
Row.Cells(1).AddText trim(Rs("ORDINE")), param
Row.Cells(2).AddText trim(Rs("QUANTITA")), param
param.Add "alignment=center"
Row.Cells(3).AddText Rs("PREZZO"), param
Row.Cells(4).AddText trim(Rs("PRODOTTO")), param
param.Add "alignment=center"
Row.Cells(5).AddText trim(Rs("FUNZIONE")), param
if strfnzrd <> trim(Rs("FUNZIONE"))and strfnzrd <> "" then
Set Row = Table.Rows.Add(20)
param.Add "alignment=center"
Row.Cells(2).AddText "TOTALE", param
Row.Cells(3).AddText totprzfnz, param
totprzfnz = 0
else
totprzfnz = totprzfnz + Rs("PREZZO")
end if
strfnzrd=trim(Rs("FUNZIONE"))
rs.MoveNext
Loop