Good day to you all,
I feel very excited being in the midst of gurus and great enthusiasts of programming...
I have a little challenge in completing a program intended to read records from a file <notepad> and place them in an orderly manner on a pdf file <so as to view how it would look like just before printing in hard copy>.
My only hitch was <is> in viewing more than a page at a time; thereby having all other records beyond the 14th not viewable. Below is the VB.NET code I used.
For rec As Integer = 0 To recordData.Length - 1 Dim myRec() As String = Regex.Split(recordData(i + 1), ",") 'Check if next record is the 14th record If (i + 1) Mod 14 = 0 Then Dim remaining As Integer = recordCount - (i + 1) If remaining \ 14 <> 0 Then e.HasMorePages = True Else 'indicate that this is the last page to print e.HasMorePages = False End If End if firstColumn = (firstColumn + 1) Mod 2 ' 2 records per row For j As Integer = 0 To myRec.Length - 1 'Draw your strings If firstColumn = 0 Then 'Code that prints records on first column ' is placed here Else 'Code that prints records on second column ' is placed here End If Next If countRecords Mod 2 = 0 Then 'code that allows modification of x and y coordinates ' so as to print on the next row after every two records End If
When I use the "e.HasMorePages" for large records as I've done above, it'd only print the first page and ignore others.
I'd be grateful if you can show me what I'm doing wrong.