Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2007

Tip: Looking for answers? Try searching our database.

PrintPreviewControl navigate pages problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Dunaway - 30 Mar 2007 15:11 GMT
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
Chris Dunaway - 30 Mar 2007 17:15 GMT
> I am using the PrintPreviewControl on a custom form to display a
> report.  The report is multiple pages.  I have a NumericUpDown control
[quoted text clipped - 19 lines]
>
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.