Zoom Setting
I am trying to control the zoom setting when launching a report from the
report explorer.
ppReportexplorer1.ppDesigner1.Report := ppReport1;
ppReportExplorer1.PrintPreview('Sales Order', 4);
I have this event coded, which works usually - but does not work when
launching from ReportExplorer
procedure TD_OrderDlg.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppViewer((Sender as TppReport).PreviewForm.Viewer)
.ZoomSetting := zsPageWidth;
end;
Does anyone know how to do this?
Thanks - Davis Peterson
report explorer.
ppReportexplorer1.ppDesigner1.Report := ppReport1;
ppReportExplorer1.PrintPreview('Sales Order', 4);
I have this event coded, which works usually - but does not work when
launching from ReportExplorer
procedure TD_OrderDlg.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppViewer((Sender as TppReport).PreviewForm.Viewer)
.ZoomSetting := zsPageWidth;
end;
Does anyone know how to do this?
Thanks - Davis Peterson
This discussion has been closed.
Comments
event. This is a public event that you need to hook up at runtime.So, you
have to assign an OnLoadEnd event handler to be able to get the timing after
a report is loaded from the explorer in order to assign the
OnPreviewFormCreate event handler to the selected report:)
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
handlers.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Thanks
Never mind - got it. this seems to work. thanks for your help.
procedure TD_OrderDlg.FormCreate(Sender: TObject);
begin
ppReport1.Template.OnLoadEnd := OnLoadEnd;
end;
procedure TD_OrderDlg.OnLoadEnd(Sender: TObject);
begin
ppReport1.OnPreviewFormCreate := ppReport1PreviewFormCreate;
end;
procedure TD_OrderDlg.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppViewer((Sender as TppReport).PreviewForm.Viewer)
.ZoomSetting := zsPageWidth;
end;