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

Make Print Preview Full Screen

edited August 2001 in General
The default is that the Print Preview opens as a window. How do I make it
open full screen?

Thanks,
Roy

Comments

  • edited August 2001
    The above thread talks about this, but it is as easy as one event handler:

    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.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,
    Thank You for the info. I added the handler putting in the name of my
    TppReport component (rptAssembly) and added ppViewr to uses clause. Here is
    the code I used

    procedure TdtmJobRpt.rptAssemblyPreviewFormCreate(Sender: TObject);
    begin
    rptAssembly.PreviewForm.WindowState := wsMaximized;
    TppViewer(rptAssembly.PreviewForm.Viewer).ZoomSetting := zs100Percent;
    end;

    When I compile I get "[Error] JobRpt.pas(381): Undeclared identifier:
    'wsMaximized'". If I comment out "rptAssembly.PreviewForm.WindowState :=
    wsMaximized;" , then the second line compiles OK.

    What am I doing wrong?

    Thanks,
    Roy
  • edited August 2001
    Add ppTypes to your uses clause.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,

    I already had ppTypes in uses. Here is my uses clause:

    uses
    SysUtils, Classes, DB, DBTables, ppCtrls, ppVar, ppPrnabl, ppClass,
    ppBands, ppCache, ppDB, ppProd, ppReport, ppComm, ppRelatv, ppDBPipe,
    ppStrtch, ppSubRpt, DBXpress, Provider, SqlExpr, DBClient, DBLocal,
    DBLocalS, FMTBcd, ppTypes, ppViewr;

    So the question remains, what am I doing wrong?

    Thanks,
    Roy


  • edited August 2001
    Sorry, it is declared in Forms in Delphi.

    type TWindowState = (wsNormal, wsMinimized, wsMaximized);


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,
    I do not understand how to implement your last instruction. I am using
    Delphi6 and the ppReport component is in a data module. The data module
    does not have a WindowState property. In Report designer if I select the
    report and look at the object inspector, there is no WindowState property.
    Do I have to create a form just of the ppReport component and then set its
    WindowState or can I do this some other way?

    Thanks,
    Roy

  • edited August 2001
    Add Forms to your uses clause.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim,
    Now it is working. Thank You. It will help others if needing Forms in the
    uses clause is added to this subject in the tech-tips section.

    WindowState would be a good candidate for a new property in ppReport.

    Also, it seems to me, that if you want to preview a report, that, you want
    to see it. Most reports these days go to 8 .5 x 11 in paper and to best see
    them you need to be maximized. All that is to say, that, my preference
    would be for the preview default be maximized.

    Thanks again,
    Roy

This discussion has been closed.