473,431 Members | 1,592 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,431 software developers and data experts.

Problem with printing (HasMorePages ???)

I have figured out everything I need to print what I need to print except to
handle the HasMorePages property..

I'm looping thru a DataTable and sometimes the number of rows exceeds the
lines on the printingpage I have (depending on the fontsize and family and
all that)

When I come to the end of the PrintPage event.. .I know I have more rows in
the table that what I can fit on one page and I set the HasMorePages to
true.. then the eternal loop starts...

It fires off the PrintPage event again and do not keep track of what's
already been sent to the printer and starts to print from the start in the
table again..

Is there nothing easy that will keep track of the PageBreaks for me? Do I
need to keep track of how many lines I have printed from the Datatable
already when the Print Page fires off the second time?

All the examples I can find do not go this far in examples...

Best Regards/
Lars Netzel
Nov 23 '05 #1
2 1436
Lars Netzel wrote:
It fires off the PrintPage event again and do not keep track of what's
already been sent to the printer and starts to print from the start in the
table again..

Is there nothing easy that will keep track of the PageBreaks for me? Do I
need to keep track of how many lines I have printed from the Datatable


HasMorePages, as you have discovered, merely causes the PrintPage event
to fire again. It is up to you to keep track of what you have printed
and where to start printing on the next page.

Nov 23 '05 #2
thanx.. just wanted to hear my suspecions from someoneelse.. :) I have
rowked things be keepin gtrack of things myself then.
"Chris Dunaway" <du******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Lars Netzel wrote:
It fires off the PrintPage event again and do not keep track of what's
already been sent to the printer and starts to print from the start in
the
table again..

Is there nothing easy that will keep track of the PageBreaks for me? Do I
need to keep track of how many lines I have printed from the Datatable


HasMorePages, as you have discovered, merely causes the PrintPage event
to fire again. It is up to you to keep track of what you have printed
and where to start printing on the next page.

Nov 23 '05 #3

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
3
by: Mikael Syska | last post by:
Hi, I'm reading Beginning Visual C-Sharp by wrox, great book by the way. In the book the describe how I can print, and it works great, but what if I has like 300 lines, that wont fit on a...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
6
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...
3
by: islay | last post by:
Hello, I'm trying to print more than one page using the PrintDocument object. I set "e.HasMorePages = True" after completeing the first page in the "PrintDocument1_PrintPage" subroutine, and...
5
by: Chuck Gantz | last post by:
I'm using vb2005. I wrote a simple app to view and print all the fonts on my pc.To see how the printout will look without wasting lots of paper, I use PrintPreviewDialog. The first time I run...
1
by: Zimba | last post by:
I want to take a new page while running over a resultset. I made a very simple sample, i want to take a new page in "Afdrukken" It's easy to say test on 14000 and don't test in "Afdrukken" but this...
4
by: DeWittds | last post by:
I have asked before and got little responce, So I try and try again. The code below prints the data in the same place but does not advance the page. I can see the lblnumber change but print in...
2
by: tghamm | last post by:
Ok, so this is driving me mad. For some reason, regardless of the value of ev.hasmorepages, the printoducment1_printpage gets called twice for every page. So, I print 2 pages of data on one page,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.