Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Multipage Printing - How do I Implement It?

Thread Tools

Multipage Printing - How do I Implement It?

Posts: n/a
The Visual Basic .NET Step by Step book has the following code and text:

Imports System.Drawing.Printing

Private Sub PrintText(ByVal sender As Object, ByVal ev As
ev.Graphics.DrawString(TextBox1.Text, New Font("Arial", 11,
FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim PrintDoc As New PrintDocument()
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText
Catch ex As Exception
MessageBox.Show("Sorry--there is a problem printing", ex.ToString())
End Try
End Sub

This code only prints one page. The book states "To handle multipage
printouts, you need to create a virtual page of text called the PrintPage,
and then add text to it until the page is full. When the page is full, it
will be sent to the printer and this process continues until there is no
more text to print. At this point, the print job ends."

"The PrintPage event occurs when a page is printed. PrintPage receives an
argument of the type PrintPageEventArgs, which provides you with the
dimensions and characters of the current printer page. Another mechanism is
the Graphics.MeasureString method which can be used to determine how many
characteristics & lines can fit in a rectangular area of the page"

I tried looking for information on how to implement this but found now. How
do I implement MultiPage printing?

Not only do I want to know how to multipage print using the PrintDocument
class I also do not want to use Crystal Reports or pdf for report generation
in the web browser in order to print reports from web browser. I saw the
microsoft MCP website used an ActiveX control to print your MCP Transcript.
That's exactly what I want. To pull information from an SQL Server database
and bulid mu own print page/s with the text and graphics I want on it so I
can have my report.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Implement Custom Printing Logic & Enhanced Word Documents Printing sherazam Java 0 12-26-2011 03:24 PM
MultiPage Expert Please (Dynamic MultiPage controls) Russ ASP .Net Web Controls 8 07-01-2004 08:57 PM
Multipage Printing - How do I Implement It? Nigel MCSD 1 08-16-2003 02:43 PM
Multipage Printing - How do I Implement It? Nigel ASP .Net 0 08-15-2003 03:26 PM