If new page then top ofpage?
Hello
I am using Delphi 6 with RB Enterprise 7.03.
When a report os previewed on screen and a user has, say, has the bottom
half of a page showing, and then changes to the next page, I want to have
the next page shown starting at the top of the page.
Any hints?
Thanks,
Russell Belding
I am using Delphi 6 with RB Enterprise 7.03.
When a report os previewed on screen and a user has, say, has the bottom
half of a page showing, and then changes to the next page, I want to have
the next page shown starting at the top of the page.
Any hints?
Thanks,
Russell Belding
This discussion has been closed.
Comments
Though I have not tried this, you may be able to use one of the page events
(OnStartPage perhaps) and take control of the scroll bar manually.
The TppViewer.Scrollbox property provides access to the scrollbox. The
Scrollbox VertScrollBar and HorzScrollbar properties can be used to set the
scrolling position.
There are a few options for getting access to the viewer:
1. Use the Report.OnPreviewFormCreate event to access the Report.PreviewForm
2. Create a custom preview dialog and register it with ReportBuilder. See
ppPrvDlg.pas in RBuilder\Source
3. Create a custom preview plug-in that is used by the preview dialog and
the report designer. See ppPreview.pas in RBuilder\Source.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
behaviour wanted is to see each new page requested shown from the top of the
page, not to leave the page shown as it was on the last page shown.
1)
In the class definition of the form containing myReport I declared
myReportVertScrollBar : TControlScrollBar;
2)
In myReportPreviewFormCreate
myReportVertScrollBar :=
TppViewer(myReport.PreviewForm.Viewer).ScrollBox.VertScrollBar
3)
In event handler myReportPageRequest
myReportVertScrollBar.position := 0;
Thats it.
The OnStartPage event handler fires once for each page made when the report
is first made whereas OnPageRequest fires once when the report is made and
once for each subsequent page change.
Thanks,
Russell Belding
Excellent! Glad you got it working.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com