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

Previews with windows maximized

edited November 2007 in General
D 2007; RB 10.06 pro

How do I get print previews to display maximized (vs normal) by default? I
had a descendent preview form which did that, but using it, I couldn't get
the email toolbar button to display and reflect the settings in the report
form.

Thanks.

--
Bill Skelton

Landmark Data Systems, Inc.
Two Old River Place, Suite L
Jackson, MS 39202-3435
601-362-0303

Comments

  • edited November 2007
    Hi Bill,

    If you set the Report.PreviewFormSettings.WindowState to wsMaximized you
    will get the preview window in a maximized state when it is loaded.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2007
    Duh! I should have asked...

    Is there a way to set this globally without re-visiting each report in the
    application?


  • edited November 2007
    Unable to download the news message. Not found or has been removed.


  • edited November 2007
    Hi Bill,

    You could use the Template.OnLoadEnd event to assign this property to every
    report once it has loaded.

    ----------------------------------------------
    Tech Tip: Using Template Events
    ----------------------------------------------

    The Report.Template object has several events that can be used for
    customizing what happens when a report is loaded or saved:

    - OnLoadStart
    - OnLoadEnd
    - OnNew
    - OnSaveStart
    - OnSaveEnd


    The OnLoadEnd and OnNew events are often used to perform actions related
    to report and data initialization.

    The OnSaveEnd event is often used to save additional descriptive
    ("meta") data to the database each time the report is saved.

    Example:

    The Report.Template events are public and therefore must be assigned at
    run-time.


    1. In the private section of your form declaration you can declare an
    event-handler method:

    TForm = class(TForm)
    private
    procedure myTemplateOnLoadEndEvent(Sender: TObject);

    public

    end;


    2. In the Form.OnCreate event, you can assign the event-handler to the
    event:

    procedure TForm1.FormCreate(Sender: TObject);
    begin

    ppReport1.Template.OnLoadEnd := myTemplateOnLoadEndEvent;

    end;


    3. Implement the event-handler method:

    procedure TForm1.myTemplateOnLoadEndEvent(Sender: TObject);
    begin

    {add code here to initial the report or data, etc. }
    ppReport1.PrinterSetup.MarginTop := 0.5;

    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.