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

Diable items in Print Dialog ?

edited June 2002 in General
Greetings,

I was wondering how certain items can be disabled in the PrintDialog of a
report. For example I would like to be able to disable the Current Page and
the Pages radio buttons in the Page Range Group Box and the drop down box
which allows you to print All, Odd, or Even pages in the selected range. I
saw the EnableAutoRange and DisableAutoRange properties but I could not find
them in the help and when it was set I didn't see any changes to the
PrintDialog.

Thanks in advance for any help,
Jeff

Comments

  • edited June 2002
    Make sure that you are making your changes in the report's
    OnPrintDialogCreate event.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited June 2002
    Alexander,

    I have the following code in place:

    // ************************************
    procedure TFrmMain.ppReport1PrintDialogCreate(Sender: TObject);
    begin
    ppReport1.PrintDialog.DisableAutoRange;
    end;
    //**************************************

    However when the Print Dialog is displayed none of the page ranges are
    disabled. You can select any radio button in the Page Range group box and
    enter any value in the text box next the the Pages radio button.

    How can I get these fields disabled so they may not be chosen?

    Thanks,
    Jeff



    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited June 2002
    DisableAutoRange doesn't do what you think it does. The method is of
    TScrollingWindow, it temporarily disables scrolling. You need to directly
    access components of the window to change their state. For example the code
    below will disable the page range checkbox and editbox. See the ppPDlg unit
    for names of the rest of the components on the dialog.

    procedure TForm1.ppReport1PrintDialogCreate(Sender: TObject);
    begin
    TppPrintDialog(ppReport1.PrintDialog).edtPageRange.Enabled := False;
    TppPrintDialog(ppReport1.PrintDialog).rdbPages.Enabled := False;
    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.