473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Multipage Printing - How do I Implement It?

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
PrintPageEventArgs)
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
Try
Dim PrintDoc As New PrintDocument()
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText
PrintDoc.Print()
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.
Nov 17 '05 #1
0 1462

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: news.microsoft.com | last post by:
Hello group, My goal is to attach an image over another image. Top image should be transparent so the back image is visible through the top one. Bellow is a test code in VB.NET. You need to...
1
by: szabelin | last post by:
Is it possible to dynamically add a PageView to MultiPage? TabStrip has items property, so Tab and TabSeparator can be added... how about adding PageView to MultiPage? If not possible please...
1
by: Dan | last post by:
IE WebControls Tab/MultiPage state problem I have a IE tab/multipage on a WebForm (aspx) like this: <code> <iewc:TabStrip id="tabs" runat="server" TargetID="MultiPage1"> <iewc:Tab...
2
by: Child | last post by:
I have a page which has a tabbstrip and a multipage. The tab strip works great, and navigates the multipage no problem. However, I have a situation where I would like to have a "hidden"...
1
by: GW | last post by:
Trying to force a new page when required using e.HasMorePages = True but not having much luck. All prints OK except for trying to figure out how to do a page feed without exiting the loop. ...
2
by: Bdog | last post by:
I've been searching for the file PrintFramework.zip that I've seen linked on tons of posts but all the links are bad. Does anynone know where I can get a copy of this code, I hoping it is what I...
1
by: Ira | last post by:
I was successful in creating the multipage Tif files in VB.net using the following the following code: Public Sub SaveSeveralOnePageFilesInADir(ByVal DrNm As String, ByVal resultFl As String)...
0
by: Amol J Kothawade | last post by:
Hi, I want to print one page at a time in multipage document. When first page printed my application will give me the message then ask for continuation of next page. I want to develop app in...
4
by: shaiful | last post by:
Hi. I have a simple problem with multipage. I placed Multipage control on my form, but there are only 2 pages in multipage control by default. I would like to increase more pages with multipage...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.