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