Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PrintDocument Questions

Status
Not open for further replies.

GhostWolf

Programmer
Jun 27, 2003
290
US
I'm finally getting started with PrintDocument and, naturally, having trouble... I've figured out how to get text printed on a page, but am having difficulty with pagination.

Our clerks handle many transactions in a day, but only some of the transactions need to be printed; the printed documentation for each transaction takes up a little less than half of a page. Currently, they print the transaction, cut off and recycle the bottom half of the page.

What I'd like to do is to print two transactions per page. The trick is that the user might print a transaction now, and not need to print another until a half-hour later, (with twenty other transactions between them).

Since Graphics.HasMorePages=True causes the PrintHandler subroutine to immediately execute again, it serves no purpose to my needs; I'm assuming that HasMorePages=False is the default, since I've found that the page prints immediately when the subroutine completes without setting HasMorePages, (my tests have given me either a completed top half, or a completed bottom half - but not a full page).

Is there a way to hold the print until I've populated both halves of the page? I'm beginning to suspect that I'll need a structure to hold the two sets of data, and not print until the structure is loaded with both transactions, (and make allowances for the user to print only a single transaction when needed).
 
Not finding a means, (within PrintDocument), to load half of the page now, and come back later to load the other half of the page - not actually sending the page to the printer until two transactions have been put on the page - I've opted for a two-element array of a data structure.

This method works quite nicely - but I still think PrintDocument should allow multiple passes at putting data on a page, and not printing the page until I'm ready.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top