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

How can I maximise the PrviewForm in Code.

edited May 2003 in RAP
In PreviewFormCreate event normally I use,
ppReport1.PreviewForm.WindowState := wsMaximized;

How can the same be applied in RAP ?

Thanks

Moorthy
~~~~~~

Comments

  • edited May 2003
    In RAP, reference the Report.PreviewFormSettings.ZoomPercentage and
    WindowState properties accordingly. Use the
    Report.OnAssignPreviewFormSettings event or any earlier event, such as the
    global OnCreate. You'll need RB 7.0 or greater to use this new property.
    Previously, you would need to use the Report.OnPreviewFormCreate event:

    ------------------------------------------------
    Tech Tip: Controlling the Built-in Previewer
    ------------------------------------------------

    You can control the built-in preview form via the
    Report.OnPreviewFormCreate event.

    For example the following code sets the Print Preview form to
    maximized and sets the Viewer ZoomSetting to 100%:

    procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
    begin


    ppReport1.PreviewForm.WindowState := wsMaximized;
    TppViewer(ppReport1.PreviewForm.Viewer).ZoomSetting := zs100Percent;


    end;



    Note: You will need to add ppViewr to the uses clause of your unit,
    so that the ZoomSetting enumerated type is recognized by the
    compiler.


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.