Printing Multiply Pages

  • Thread starter Thread starter James Proctor
  • Start date Start date
J

James Proctor

Hi there, im creating a print out or a report but when it
gets to the bottom off one page, or a set position on
that page i want it to go onto another page. How do i
tell .net to move onto a new page. I cant seem to see it
anywhere. Hopefully someone can help.

Regards

JP
 
Hi,

By setting e.hasmorepages to true it will fire the printdocument
printpage event to print another page. Here is a very simple example.

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e
As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

Static x As Integer = 0

x += 1

e.Graphics.DrawString(x.ToString, Me.Font, Brushes.Black, 10, 10)

e.HasMorePages = (x < 10)

End Sub

Ken
 
* "James Proctor said:
Hi there, im creating a print out or a report but when it
gets to the bottom off one page, or a set position on
that page i want it to go onto another page. How do i
tell .net to move onto a new page. I cant seem to see it
anywhere. Hopefully someone can help.

Have a look which links Google uses to allow switching to the next page.
 
* "James Proctor said:
Hi there, im creating a print out or a report but when it
gets to the bottom off one page, or a set position on
that page i want it to go onto another page. How do i
tell .net to move onto a new page. I cant seem to see it
anywhere. Hopefully someone can help.

Are you using .NET's 'PrintDocument' or a report engine like Crystal
Reports? When using 'PrintDocument', have a look at its 'PrintPage'
event. There you you set 'e.HasMorePages' to 'True' which will cause
the handler to be called again.
 
* (e-mail address removed) (Herfried K. Wagner [MVP]) scripsit:
Have a look which links Google uses to allow switching to the next page.

That should have been a reply to the thread "above" this one.
 
Back
Top