Salve a tutti, sto facendo un programma e ho riscontrato un problema nella stampa. In pratica devo stampare i dati di una ListView tramite printdocument. Il mio problema è che mi stampa solo una pagina, riempiendo la pagina il resto non lo stampa più. Potete aiutarmi?? grazie in anticipo.
Ecco il codice:
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
int H = 0;
H = 50;
e.Graphics.DrawString("Lista Primo Semestre - Comune di Poggioreale", new System.Drawing.Font("Times New Roman", 20), Brushes.Black, 50, H);
H += 50;
foreach (ListViewItem Itm in ListView1.Items)
{
e.Graphics.DrawString(" Genitore ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 50, H);
e.Graphics.DrawString("Codice Fiscale ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 250, H);
e.Graphics.DrawString("Residenza ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 450, H);
e.Graphics.DrawString("Via ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 650, H);
e.Graphics.DrawString(" Iban ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 850, H);
H += 20;
e.Graphics.DrawString(Itm.Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 50, H);
e.Graphics.DrawString(Itm.SubItems[1].Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 250, H);
e.Graphics.DrawString(Itm.SubItems[2].Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 450, H);
e.Graphics.DrawString(Itm.SubItems[3].Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 650, H);
e.Graphics.DrawString(Itm.SubItems[4].Text, new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 850, H);
H += 30;
e.Graphics.DrawString("Alunno ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 50, H);
e.Graphics.DrawString("Importo da Liquidare ", new System.Drawing.Font("Times New Roman", 12), Brushes.Black, 250, H);
H += 20;
e.Graphics.DrawString(Itm.SubItems[5].Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 50, H);
e.Graphics.DrawString(Itm.SubItems[9].Text, new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 250, H);
H += 25;
e.Graphics.DrawString("----------------------------", new System.Drawing.Font("Times New Roman", 10), Brushes.Black, 50, H);
H += 25;
}
}