473,785 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

In the handler QueryPageSettin gs 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 1574
* " Just Me" <ne********@a-znet.com> scripsit:
In the handler QueryPageSettin gs 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 QueryPageSettin gs 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 QueryPageSettin gs (but that's not
without a problem). I wish I could in QueryPageSettin gs 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
QueryPageSettin gs 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 QueryPageSettin gs (but that's not
without a problem). I wish I could in QueryPageSettin gs 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
QueryPageSettin gs 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_NextPageToPri nt As Integer

Private Sub MyPrintDocument _PrintPage(...) Handles ...
Select Case m_NextPageToPri nt
Case 1
e.Graphics.Draw String(...)
Case 2
e.Graphics.Draw String(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageB ePrinted(...)
End Sub

Private Function ShouldNextPageB ePrinted(...) As Boolean
If ... Then
...
m_NextPageToPri nt = 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 QueryPageSettin gs (but that's not
without a problem). I wish I could in QueryPageSettin gs 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
QueryPageSettin gs 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_NextPageToPri nt As Integer

Private Sub MyPrintDocument _PrintPage(...) Handles ...
Select Case m_NextPageToPri nt
Case 1
e.Graphics.Draw String(...)
Case 2
e.Graphics.Draw String(...)
Case 3
...
Case 4
...
End Select
e.HasMorePages = ShouldNextPageB ePrinted(...)
End Sub

Private Function ShouldNextPageB ePrinted(...) As Boolean
If ... Then
...
m_NextPageToPri nt = 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
2484
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 with it. The problem is that we *Sometimes* get the ORA-24338 error when executing a query. This problem occurs random, sometimes twice a day, sometimes not at all. In
13
2624
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 colors that becomes visible when in hover or active state using css) is the best approach. Is there any place on the net where this is addressed? Thanks in advance.
4
1895
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 itself into its own "test" page, it holds together fine:
2
6719
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 to be fitted/enlarged to original size. The page on the below address: http://www.kapy.bydg.pl/~marcinz/stolarnia/. I have Windows XP and IE 6.0. and everything works correctly. If I run the page on Win 2000, IE 5.0.
59
6878
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
5779
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 macros */ #ifndef PUBLIC #define PUBLIC
2
3235
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 value="3">Item 3</option> <option value="4">Item 4</option>
0
1068
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 runs contrary to my experience. On Apr 21, 1:26 am, "Frans Bouma " <perseus.usenetNOS...@xs4all.nlwrote: We wouldn't be having this conversation if it had thrown an error. It doesn't. For as much as I'd like linq to provide its own default
0
3726
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 selection changed causes sometimes no CurrentChanged event - cells are in different rows. If you click in the rowheader, the CurrentChanged event always occur, the CurrentChanging event exhibits the same behavior. A Textbox bind to the CurrentItem of ...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.