473,992 Members | 5,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PrintPreviewCon trol navigate pages problem.

I am using the PrintPreviewCon trol on a custom form to display a
report. The report is multiple pages. I have a NumericUpDown control
on the form to navigate the pages of the report. In the ValueChanged
event of the UpDown control I change the StartPage property like this:

private void udPageNo_ValueC hanged(object sender, EventArgs e)
{
ppReport.StartP age = Convert.ToInt32 (udPageNo.Value );
}

This works fine when *increasing* the page number, but it does not
work when paging down!

If I place a call to InvalidatePrevi ew just after I set the StartPage
property, then the page will change (going back down) but it causes
the preview to be regenerated. The preview is slow in generating so I
don't want to take this route.

Has anyone else experienced this issue? Is there a work around?

Thanks,

Chris

Mar 30 '07 #1
1 5738
On Mar 30, 9:11 am, "Chris Dunaway" <dunaw...@gmail .comwrote:
I am using the PrintPreviewCon trol on a custom form to display a
report. The report is multiple pages. I have a NumericUpDown control
on the form to navigate the pages of the report. In the ValueChanged
event of the UpDown control I change the StartPage property like this:

private void udPageNo_ValueC hanged(object sender, EventArgs e)
{
ppReport.StartP age = Convert.ToInt32 (udPageNo.Value );
}

This works fine when *increasing* the page number, but it does not
work when paging down!

If I place a call to InvalidatePrevi ew just after I set the StartPage
property, then the page will change (going back down) but it causes
the preview to be regenerated. The preview is slow in generating so I
don't want to take this route.

Has anyone else experienced this issue? Is there a work around?

Thanks,

Chris
For anyone else dealing with this same problem, the cause was a
boneheaded mistake by the developer (me). The StartPage property is 0
based. However, if you assign a page number beyond the number of
pages, it does not seem to throw an ArgumentOutOfRa nge exception. I
might have caught the problem sooner if I had gotten an exception.

Oh well,

Chris

Mar 30 '07 #2

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

Similar topics

0
1019
by: Chad Chisholm | last post by:
I have the PrintPreviewControl on a form, a custom print options dialog. When the user changes a print option (like gridlines) I set the Document property of the PrintPreviewControl, thereby forcine a redraw of the document. The problem is that when it redraws, the "Generating Preview..." dialog appears. When it closes, my app has lost the focus. Has anyone experienced this? Can anyone address this issue?
0
1204
by: sachin | last post by:
How to sence click event on the document when two pages are displayed in PrintPreviewControl. How to identify which page is clicked Moreover can we hookup Vertical scroll bar to Next/Previous Page, i.e. similar to PrintPreviewDialog.
0
1428
by: Yaron | last post by:
Hi, I have a PrintPreviewControl placed inside an inherited control (I am designing a wizard, and each wizard 'panel' is technically a control... The PrintPreviewControl is inside one of these panels). The problem is that when I place the control, and set its Document property to a PrintDocument class, it seems to 'steal' focus away from the main wizard dialog (the titlebar of the wizard actually becomes gray), and weird graphical glitches...
0
1352
by: Sachin | last post by:
Hello, I am trying to make a customized PrintPreviewDialog using PrintPreviewControl. Can any one please explain how to change the cursor only on the document that is displayed in the Preview control? We can use the cursor property of the PrintPreviewControl, but that is not useful, as when you move in to the Preview control, the cursor changes even if you are not on the document. Is there any way to get the document area, so that we can check...
0
1118
by: Chad Chisholm | last post by:
I have the PrintPreviewControl on a dialog, and it's a great way to show the user what effect print settings have in somewhat real time. The only problem is when I set printPreviewControl.Document to a printdocument, a dialog pops up that it's generating the preview and when that goes away, my app has lost focus. I can't seem to find a way around this. Have ANY of you had luck with this?
1
2973
by: Tim | last post by:
Hi, I want to use a PrintPreviewControl instead of the dialog which is too restrictive. I have found a basic tutorial but I have lots of other questions: 1. How do I implement next and previous buttons? 2. How do I change the cursor only when it is over the document? 3. How do I implement zoom buttons? 4. What about showing multiple pages per screen?
0
1001
by: madval | last post by:
How can I get the pages of printPreviewDialog or printPreviewControl as images (if possible without openning the dialog)?? I am printpreviewing the content of a richtextbox and I want to screenshot the printed pages. thanks
3
8875
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the "Generating Previews" dialog box while the preview is being generated. I want to suppress this. I've been able to find this from another forum: "The 'Generating Previews' dialog is shown while calculating the layout for pages in OnPaint(). One of our...
3
6526
by: IB | last post by:
... Can't get it to work. Whatever I do, I just get "document does not contain any pages". I am setting the document property to a valid document and if I just use the PrintPreviewDialog instead, my page appears fine (on the dialog). Any ideas? Thanks
0
10411
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11926
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
11495
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...
0
10998
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
10160
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
8554
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
7711
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6507
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...
3
3842
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.