Ciao a tutti, Antonio un saluto speciale
Devo stampare dei dati che provengono da una base dati, usando il webhtmlviewer.
var rsEtapa2 as RowSet
rsEtapa2 = Session.mDB.SelectSQL("SELECT * FROM etapa_2 WHERE op = ?", op)
for Each row as DatabaseRow in rsEtapa2
htmlEtapa2 = ("<html><body>"+_
"<hr>"+_
"<h4 style='font-family:Montserrat'>ETAPA 2: PESAJE DE MATERIAS PRIMAS</h4>"+_
"<div style='font-family:Montserrat'>"+_
"<table style= 'width:100%' 'border: 1px solid black'>"+_
"<thead style= 'text-align:left'>"+_ // start head table
"<tr>"+_
"<th style='width:10%'>Control</th>"+_
"<th style='width:60%'>Materia Prima</th>"+_
"<th style='width:10%'>%</th>"+_
"<th style='width:10%'>Gramos</th>"+_
"<th style='width:10%'>Pesado</th></tr>"+_
"</thead>"+_ // head table
"</div>"+_
"<tbody>"+_
"<tr>"+_
"<td>" + row.Column("control").StringValue + "</td>"+_
"<td>" + row.Column("materia_prima").StringValue + "</td>"+_
"<td>" + row.Column("percentuale").StringValue + "</td>"+_
"<td>" + row.Column("grammi").StringValue + "</td>"+_
"<td>" + row.Column("pesado").StringValue + "</td></tr>"+_
"</tbody></table>"+_
"</body></html>")
next
var stampa as String = htmlBatchRecord + htmlEtapa2
HTMLViewerPrintBatchRecord.LoadHTML(stampa)
Uso i tag html per formattare il testo ed un ciclo each for per i dati da stampare.
L’unico problema che riscontro e’ che della base dati(dei dati che sono stati filtrati) mi stampa solo l’ultimo valore invece di stamparli tutti
Dall’immagine che ti allego nella Etapa 2 come puoi vedere stampa solo un valore.
Non vedo dove sto sbagliando.
Mi puoi dare una mano per favore?
Grazie come sempre per il tuo aiuto