Problem with printing (HasMorePages ???)

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

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
 
Lars said:
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.
 
thanx.. just wanted to hear my suspecions from someoneelse.. :) I have
rowked things be keepin gtrack of things myself then.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top