473,564 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing with multiple pages

Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.
Nov 16 '05 #1
3 7172
Set the HasMorePage Property to true, in the PrintEvent

"John Sutor" wrote:
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #2
Set the HasMorePage Property to true, in the PrintEvent

"John Sutor" wrote:
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #3
John,
There are some examples in the VS projects. In short you use a
PrintDocument subclass and keep the datastream position either in a class
variable for that subclass or, if you are just providing OnPrintPage
handling to the standard PrintDocument, in a class variable. Everytime you
get to the bottom of the page and there is more data set HasMorePages to
true and return. If you are going to use print preview and printing make
sure to handle OnBeginPrint and reset the position of your print stream back
to the beginning there so it can print to the printer from the preview if
desired.
I've found it easiest to make a complete subclass of PrintDocument and
implement OnBeginPrint, OnEndPrint, and OnPrintPage for all my documents. I
store my data stream and the current position in class variables. I
allocate all my custom Fonts and Pens in OnBeginPrint and then deallocate
them in OnEndPrint. If you have documents that change orientation within
them you can implement OnQueryPageSett ings as well.

Ron Allen

"John Sutor" <jo********@cin fin.com> wrote in message
news:ed******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to print multiple page documents? I can print from a
test box or a one page document, but not one with multiple pages.

Nov 16 '05 #4

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

Similar topics

10
23286
by: Jeff B. | last post by:
Has anyone come across a decent algorithm for implementing word wrap features in .net printing? I have a small component that uses basic printing techniques (i.e. e.Graphics.DrawString in a PrintPage event of a PrintDocument object) to send some formatted text to the printer. However, if the lines are too long they run off the page rather...
4
3725
by: Jay | last post by:
Still can't seem to find a solution to printing a lengthy datagrid on multiple pages including datagrid headeron each page. I am not using Crystal Reports or Reporting Services or VStudio. Any idea how this can be done? Any links, examples Thanks a lot.
2
8175
by: ray well | last post by:
hi, i need to print multiple pages on a printer. this is what i'm using now Sub Print() Dim PrintDoc As New PrintDocument AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText Do While bPrintingNotDone PrintDoc.Print()
6
482
by: Bill | last post by:
Hi I am trying to get my listbox items to print if they stream past the one page mark. my code is working for one page of information (if the e.hasmorepages) is not there. But I am having trouble getting it to print on multiple pages. The second page will not print at all. Thanks in advance
6
4078
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if the user wants all pages will produce 3 pages. I want to offer the user the ability to select via the print dialog that only pages 1 and 2 of it...
0
1334
by: ben.agnoli | last post by:
I have written the below class for printing out large jpg files (1 page wide, multiple pages high) over multiple pages. The class will get instantiated multiple times at once by a windows service. For each page that the class prints, it gets visibly slower, when the third document, third page and onwards starts to print, it takes over 20...
18
11270
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I...
0
2828
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the printing printing data and the actual database data in a recordset. the class looks like this: Public Class BRPDD 'Balance Report PrintingDocument Data ...
1
2894
by: charitha0 | last post by:
Hi, Can any one help in printing a html table content (dynamically generated which spreads accorss multiple pages ) in landscape by default. The following code does not work when we have a table with lot of rows which spans accross multiple pages. Nothing shows up in print preview <html> <head> <object id="factory" viewastext...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.