Home Devices

Controling Page Range at runtime in the Print Dialog?

edited June 2003 in Devices
Hi,

When calling method ppViewer1.Print I get to display the Print Dialog.
In this Print Dialog there are the fields in the group box Page Range: all,
Current page and Pages.
Are there any possibility to control the Page Range fields at runtime,
because I want to make Current Page checked and the other two selections
disabled before showing the Print Dialog

I'm using:
Delphi 7.0
ReportBuilder 7.02 Build 2
Windows Xp

Best regards
Steffen Kristensen

Comments

  • edited June 2003
    You can access the print dialog like this to check the CurrentPage option
    when it is shown:

    uses
    ppTypes,
    ppDevice;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppReport1.Print;
    end;

    procedure TForm1.ppReport1PrintDialogCreate(Sender: TObject);
    begin
    TppPageRequest(ppReport1.PrintDialog.PageRequest).PageSetting :=
    psSinglePage;
    end;


    To disable the other controls, you should create your own form replacement
    to add two properties to diable the other controls. Essentially, copy
    ppPDlg.pas and rename the unit and class. Then at the bottom of the unit,
    make sure you register your new form class. This way your class will be
    created instead of the our default registered TppPrintDialog class. All
    forms in RB are replacable (except the designer form).


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.