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

PrintPreviewControl navigate pages problem.

I am using the PrintPreviewControl 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_ValueChanged(object sender, EventArgs e)
{
ppReport.StartPage = 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 InvalidatePreview 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 5661
On Mar 30, 9:11 am, "Chris Dunaway" <dunaw...@gmail.comwrote:
I am using the PrintPreviewControl 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_ValueChanged(object sender, EventArgs e)
{
ppReport.StartPage = 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 InvalidatePreview 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 ArgumentOutOfRange 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
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...
0
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,...
0
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...
0
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...
0
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...
1
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...
0
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...
3
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...
3
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.