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

How to cancel preview if user clicks the print button

edited August 2004 in RAP
Hello,

i want to cancel the complete printjob, if the user clicks on the print
button in the preview window.
Special reports schould not be printed to the printer or exported to file.
Therefore i am looking for a method to do this. "Report.Cancel" does not
work in the "OnCreatePrintDialog" for this.

The method should work with RAP, because the behavoir to do this depends
only on special reports.

Any idea?


chris
EULANDA? Software

Comments

  • edited August 2004


    Use the Report.OnPrintDialogClose event to set the ModalResult to 2 - this
    is equivalent to mrCancel (mrCancel is not currently defined to the RAP
    RTTI). I just tested this from RAP and it worked.

    Report.PrintDialog.ModalResult := 2;


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.