Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Zoom Setting

edited April 2003 in End User
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

Comments

  • edited April 2003
    Be sure that you assign the event handler in the Report.Template.OnLoadEnd
    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


  • edited April 2003
    Look in our main End User Report Explorer demo. It assigns these two event
    handlers.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited April 2003
    Could you give me some sample code?

    Thanks

  • edited April 2003

    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;



This discussion has been closed.