I have a file which is similar to a csv file with 40 fields. Each of the fields needs to be printed in columns and rows and when I print it looks like a spreadsheet. WHen the page is full i need to throw a new page and continue until I reach the file end. The analysis of the the file is quite complex. One of the fields out of the 40 can contain in its own right 40 fields which also can produce rows on my spreadsheet.
The known factor and crucial issued is when I reach an Ypos (vertical) position of about 1000 on the page i want to start a new page. This is what i have done so far but either get indefinate pages which never starts to print or one page which continues to overlap the text for page 2, 3, 4 etc.
I have attached my code and a printout of what i achieve when printing :)
Richard
FroglegPosted Mar 25, 2011, 4:28 AM
e.HasMorePages = True will give you more pages but you need to tell it where to start and stop
At top of form 1 put
Dim pageNum as Integer = 0
In your printing code at the beginning of first page put
If pageNum = 0
'printing code
pageNum = 1
e.HasMorePages = True
EseIf pageNum = 1
'printing code
pageNum = 2
e.HasMorePages = True
End If
etc
on last page
e.HasMorePages = False