|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
PrinterSettings.PrintRange, print only selected pages.Hi, can anyone help me with the printrange functionality?
The problem is: whatever I try allways all the pages are print (directly to the printer or via a preview control). The VS-Build in help suggests checking the Printdocument.PrintPage event during printing. And indeed I can check if the current page in the Printpage event should be printed or not. But HOW to cancel the current page, if the page should not be printed, rather than the printjob? I don't want blanc pages. Regards Coen. Coen,
Try putting some logic in the PrintPage event that will advance to the next page if the page # is not in range before starting to draw the page. And, of course, make sure to exit when no more pages are available. This is how I do partial page range printing (although my exclusions are based on page type normally). I just have a PrintPage event that manages the page selection and doesn't do any drawing and then farms out the drawing to a seperate method in the class. Ron Allen Show quoteHide quote "Coen" <cbus***@newsgroups.microsoft.com> wrote in message news:3DDAD735-D9F4-47F3-9A7D-BA27844C61AD@microsoft.com... > Hi, can anyone help me with the printrange functionality? > > The problem is: whatever I try allways all the pages are print (directly > to > the printer or via a preview control). > > The VS-Build in help suggests checking the Printdocument.PrintPage event > during printing. And indeed I can check if the current page in the > Printpage > event should be printed or not. But HOW to cancel the current page, if the > page should not be printed, rather than the printjob? I don't want blanc > pages. > > Regards Coen. Hi Ron, thanks for response.
The thing I don't understand is: ' Try putting some logic in the PrintPage event that will advance to the next page if the page # is not in range before starting to draw the page.' Not drawing the current page still causes a blank page. How to take care that some pages (the not selected pages) are not created? Coen Show quoteHide quote "Ron Allen" wrote: > Coen, > Try putting some logic in the PrintPage event that will advance to the > next page if the page # is not in range before starting to draw the page. > And, of course, make sure to exit when no more pages are available. This is > how I do partial page range printing (although my exclusions are based on > page type normally). I just have a PrintPage event that manages the page > selection and doesn't do any drawing and then farms out the drawing to a > seperate method in the class. > > Ron Allen > "Coen" <cbus***@newsgroups.microsoft.com> wrote in message > news:3DDAD735-D9F4-47F3-9A7D-BA27844C61AD@microsoft.com... > > Hi, can anyone help me with the printrange functionality? > > > > The problem is: whatever I try allways all the pages are print (directly > > to > > the printer or via a preview control). > > > > The VS-Build in help suggests checking the Printdocument.PrintPage event > > during printing. And indeed I can check if the current page in the > > Printpage > > event should be printed or not. But HOW to cancel the current page, if the > > page should not be printed, rather than the printjob? I don't want blanc > > pages. > > > > Regards Coen. > > >
RANT: option strict etc
Handling DBNull from databases Final Post of the day Loopin trough colors c# to vb.net getting screen coordinates for positioning a floating control next to a tableLayOutPanel embeded con Tokenizing Emulating keyboard strokes in vb.net Refer to sheet2 - even when named Setting the Title property in a Windows File ... |
|||||||||||||||||||||||