If I set the form property KeyPreview := True and use the FormKeyPress event to intercept the keys to identify the PageUp and PageDown keys, what ppReport procedure do I call to change the page displayed in the preview form via code?
Interestingly, I can place the report in a viewer wrapper with the following code
uses; var tempViewer: TppViewer;
procedure TformTimeCardSys.ppReportPayrollSummaryPreviewFormCreate( Sender: TObject); begin tempViewer := TppViewer(ppReportPayrollSummary.PreviewForm.Viewer); end;
I have as I stated set the form's KeyPreview := True and can intercept the key press as long as the tempViewer has not been instantiated. However if the report is created via a SpeedButton.OnClick event (see below) the OnKeyDown event does not intercept the key press. As a result the case ... of you described earlier can not be invoked.
The state of the ppReportPayrollSummary.ModalPreview property has no effect.
Comments
case Key of
VK_PRIOR: FViewer.PriorPage;
VK_NEXT: FViewer.NextPage;
VK_HOME: FViewer.FirstPage;
VK_END: FViewer.LastPage;
end
Regards Uli
Thank you for your reply.
Interestingly, I can place the report in a viewer wrapper with the following
code
uses;
var
tempViewer: TppViewer;
procedure TformTimeCardSys.ppReportPayrollSummaryPreviewFormCreate(
Sender: TObject);
begin
tempViewer := TppViewer(ppReportPayrollSummary.PreviewForm.Viewer);
end;
I have as I stated set the form's KeyPreview := True and can intercept the
key press as long as the tempViewer has not been instantiated. However if
the report is created via a SpeedButton.OnClick event (see below) the
OnKeyDown event does not intercept the key press. As a result the case ...
of you described earlier can not be invoked.
The state of the ppReportPayrollSummary.ModalPreview property has no effect.
Suggestions?
TIA
John