Kyle
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
When the PrintPage event fires, you should be monitoring on your own
what page you are printing. It appears that you are not maintaining the
state correctly between pages. This event fires for the printing of a
single page.
Also, why are you fetching data in this event? I am somewhat perplexed
by this. I would think that you want to print the contents of a document
that has already been generated.
Hope this helps.
--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com
"Kyle Dunn" <ky...@trustline.com> wrote in message
news:uiWrlpAqBHA.2056@tkmsftngp03...
At the moment I'm using the graphics object that is passed to the
PrintPage event through
System.Drawing.Printing.PrintPageEventArgs e
and setting ojects to print like
Image LogoImage;
LogoImage = new Bitmap("Logo.jpg");
e.Graphics.DrawImage(LogoImage, x, y);
or using the DrawString or FillRectangle methods to generate the output.
This does work as long as it is only one page. I see I need to be
generating the page outside the the PrintPage event but does this mean
when you say to print the contents of a document that has already been
generated, you mean generated in memory or in a file? Can you give me
an example?
It makes sense that I am not maintaining state correctly between the
pages. Can you give me an example or a lead to an article that
demonstrates this?
I do greatly appreciate your reply and wish I had a better handle on
what do to. Thank you for your response and any additional help would
be appreciated.
Think of your printing as one big puzzle, with the pages being the
pieces of that puzzle. As you print out page after page, you should keep
track of what you have printed, and where you are printing it. The thing
with this puzzle is that the pieces form one long strip.
In that sense, you should keep track of the position in the data set
that you are at when you print, printing what you want on each page. When
the event fires again, pick up from where you left off and continue.
--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com
"Kyle Dunn" <ky...@trustline.com> wrote in message
news:#aJHMxBqBHA.1964@tkmsftngp07...