Fastreport FMX Allow user to stop form from printing

edited 11:45PM in FastReport VCL 5
I'm printing on a custom form. I'm using onprintreport event to ask the user to insert the proper form into the printer. I want to allow them to cancel printing if they don't have the form. I've tried assigning terminated := true, and engine.stopreport but it prints anyway.

Any suggestions are appreciated

Comments

  • edited 11:45PM
    jayE wrote: »
    I'm printing on a custom form. I'm using onprintreport event to ask the user to insert the proper form into the printer. I want to allow them to cancel printing if they don't have the form. I've tried assigning terminated := true, and engine.stopreport but it prints anyway.

    Any suggestions are appreciated

    I did not do much testing with the OnPrintReport event and I never worked with FMX... but you could try using the following code :

    RaiseException('Printing cancelled!');
  • edited 11:45PM
    Before raising exception you can also set frxReport.EngineOptions.SilentMode := True. That way the user won't see any error messages.

Leave a Comment