Fastreport FMX Allow user to stop form from printing

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 5:01AM
    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 5:01AM
    Before raising exception you can also set frxReport.EngineOptions.SilentMode := True. That way the user won't see any error messages.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.