Hi I am using vb.net with farpoint .net, I want to print 500 records on PrintDocument1, this coding works fine for the 1st page but it does not automatically generate 2nd page, 3rd page etc. there are 500 records that i want to print. please let me know how to increase pages. Thanks .. Ladak
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(txtFixedID.Text, txtFixedID.Font, Brushes.Blue, 100, 100)
e.Graphics.DrawString(txtFixedID.Text, txtFixedID.Font, Brushes.Blue, 500, 100)
Dim Msg1 As String
Dim YValue As Double
YValue = 150
For A1 = 0 To Fp1.Sheets(0).RowCount - 1
Msg1 = Fp1.Sheets(0).GetText(A1, 1)
e.Graphics.DrawString(Msg1, txtFixedID.Font, Brushes.Black, 100, YValue)
Next A1
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(txtFixedID.Text, txtFixedID.Font, Brushes.Blue, 100, 100)
e.Graphics.DrawString(txtFixedID.Text, txtFixedID.Font, Brushes.Blue, 500, 100)
Dim Msg1 As String
Dim YValue As Double
YValue = 150
For A1 = 0 To Fp1.Sheets(0).RowCount - 1
Msg1 = Fp1.Sheets(0).GetText(A1, 1)
e.Graphics.DrawString(Msg1, txtFixedID.Font, Brushes.Black, 100, YValue)
Next A1
End Sub