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

Sometimes I want to skip a page - How to do that

In the handler QueryPageSettings I let the user select a "Skip This Page"
option.

But I don't know how to handle it if he does.

I can set a flag and in PrintPage skip printing the page but the page count
in Printer and Faxes still increments.

I can cancel the entire print job but can not find anything that will enable
me to skip one page.
Anyone know how?
Nov 20 '05 #1
4 1561
* " Just Me" <ne********@a-znet.com> scripsit:
In the handler QueryPageSettings I let the user select a "Skip This Page"
option.

But I don't know how to handle it if he does.

I can set a flag and in PrintPage skip printing the page but the page count
in Printer and Faxes still increments.

I can cancel the entire print job but can not find anything that will enable
me to skip one page.


Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j************@uni-berlin.de...
* " Just Me" <ne********@a-znet.com> scripsit:
In the handler QueryPageSettings I let the user select a "Skip This Page" option.

But I don't know how to handle it if he does.

I can set a flag and in PrintPage skip printing the page but the page count in Printer and Faxes still increments.

I can cancel the entire print job but can not find anything that will enable me to skip one page.
Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.


Not sure what you mean. I now in PrintPage only bump my page number variable
and exit.

But the system must consider the fact that PrintPage is entered its a page
(I guess a blank one, I never checked).

Unless someone knows how to tell the system not to add a page to the print
document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell
the system not to add this page to the output.

To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does
for the first 9 pages but on page 10 he says not to print page 10. I don't
know what to do. As soon as I exit, PrintPage will get called and if I do
nothing in PrintPage a blank page gets added to the document.
Any ideas how avoid that?
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
* " Just Me" <ne********@a-znet.com> scripsit:
Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.


Not sure what you mean. I now in PrintPage only bump my page number variable
and exit.

But the system must consider the fact that PrintPage is entered its a page
(I guess a blank one, I never checked).

Unless someone knows how to tell the system not to add a page to the print
document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell
the system not to add this page to the output.

To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does
for the first 9 pages but on page 10 he says not to print page 10. I don't
know what to do. As soon as I exit, PrintPage will get called and if I do
nothing in PrintPage a blank page gets added to the document.


In 'PrintPage', you can do something like that:

\\\
Private m_NextPageToPrint As Integer

Private Sub MyPrintDocument_PrintPage(...) Handles ...
Select Case m_NextPageToPrint
Case 1
e.Graphics.DrawString(...)
Case 2
e.Graphics.DrawString(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageBePrinted(...)
End Sub

Private Function ShouldNextPageBePrinted(...) As Boolean
If ... Then
...
m_NextPageToPrint = 4
...
Return True
Else
Return False
End If
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
That looks good. I'd also have to do something in case the first (few)
page(s) are not printed.

Thanks a lot

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j*************@uni-berlin.de...
* " Just Me" <ne********@a-znet.com> scripsit:
Just don't print the page. How to prevent printing strongly depends on
how you handle printing of the pages.


Not sure what you mean. I now in PrintPage only bump my page number variable and exit.

But the system must consider the fact that PrintPage is entered its a page (I guess a blank one, I never checked).

Unless someone knows how to tell the system not to add a page to the print document I'll have to try do it all in QueryPageSettings (but that's not
without a problem). I wish I could in QueryPageSettings or in PrintPage tell the system not to add this page to the output.

To illustrate the problem think of a 10 page document. For each page, in
QueryPageSettings I ask the user if he want to print the page. Say he does for the first 9 pages but on page 10 he says not to print page 10. I don't know what to do. As soon as I exit, PrintPage will get called and if I do nothing in PrintPage a blank page gets added to the document.


In 'PrintPage', you can do something like that:

\\\
Private m_NextPageToPrint As Integer

Private Sub MyPrintDocument_PrintPage(...) Handles ...
Select Case m_NextPageToPrint
Case 1
e.Graphics.DrawString(...)
Case 2
e.Graphics.DrawString(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageBePrinted(...)
End Sub

Private Function ShouldNextPageBePrinted(...) As Boolean
If ... Then
...
m_NextPageToPrint = 4
...
Return True
Else
Return False
End If
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5

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

Similar topics

0
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
13
by: Monty | last post by:
I've been searching for guidance on which of the approaches used for skipping repetive links (e.g., link as normal text, link as alt text on invisible image, link with same forground and background...
4
by: Adam | last post by:
Hi all, OK, I'm baffled. I have a menu in a table which I've just realized is "breaking apart" in Safari: http://www.fitcityforwomen.com/00-intro/index.html Yet when I plunk the menu by...
2
by: Kamyk | last post by:
Hello all! Could you tell me where is the error on the below code, because the script is sometimes working correctly and sometimes is not working correctly. I want my new window with picture...
59
by: AK | last post by:
I tried to google "skip scan DB2" but came up with nothing. Does DB2 have the feature under a different name?
24
by: Robin Cole | last post by:
I'd like a code review if anyone has the time. The code implements a basic skip list library for generic use. I use the following header for debug macros: /* public.h - Public declarations and...
2
by: magix | last post by:
I have an drop down list let say: <SELECT name="id" id="id" OnClick="Skip()"> <option value="0"></option> <option value="1">Item 1</option> <option value="2">Item 2</option> <option...
0
by: d-42 | last post by:
You wrote a great deal and there is so much I would have liked to elaborate on but this really de-railed the whole debate. You posted that linq DOES throw an exception if its not ordered, and that...
0
by: Winfried Wille | last post by:
Hallo, i have a wpf project using nt 3.5sp1 and the ctp from the datagrid(downloaded thewpftoolkit from codeplex.com), silverlight final downloads are installed to. Wpf datagrid ctp cell...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.