|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to insert a page break in multi-page document?For some reason, I have to write my own code to print a document instead of using report writer. The source is an array with dynamic length. If one page is full, I have to insert a page break and print a new page to continue. The following code segment is what I'm using right now. My question is how to insert a page break in the middle of the loop since I don't find any method in PrintDocument similar to this purpose. Thanks for your attention and kindly help! James '>>> code segment Private objPrintDoc As PrintDocument Private arrData() As String Private Shared Sub PrnSlip() AddHandler objPrintDoc.PrintPage, AddressOf _PrnSlip Call objPrintDoc.Print() RemoveHandler objPrintDoc.PrintPage, AddressOf _PrnSlip End Sub Private Shared Sub _PrnSlip(ByVal sender As Object, ByVal e As PrintPageEventArgs) Dim strData As String For Each strData In arrData ' loop the array arrData and print ' if page is full, make a page break here and continue Next End Sub '>>> Hi James,
Based on my research, we need to calculate the printed content size and handle the PrintPage event to Print out our content. You can take a look at the sample in the MSDN link below. PrintDocument.PrintPage Event http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocume nt.printpage.aspx Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights.
Typed DataSet
create user and add to admin group under local system Run code under diffrent user Calling Java class from VB.net Cpmute values in Dataset Table?? How to know if Windows Update is ON or OFF? Can I do this on One line of code? Collections Woes - Help! Trick to getting System.Web.Mail to work? vb.net asp converting |
|||||||||||||||||||||||