How to know report has been printed in fastreport?
I want to implement 'one print time allowed' in authorization user(In my application).
The Question is: How to know report in fastreport has been printed?
Thanks
The Question is: How to know report in fastreport has been printed?
Thanks
Comments
The only thing that comes to my mind is to use OnReportPrint event of TfrxReport. But ...
1. That event is fired just after a user presses OK button on the print dialog, so you don't know if it really goes to a printer.
2. User can export the preview to PDF file or FP3 file and then print it many times from Acrobate Reader or from your application after loading from FP3, so you shouldn't allow him to export preview ...
Regards
Mick
this code could be modified to deal with your query and would also take care of Mick.pl's point 1
Point 2's problem also applies to cases where a standard printer selection box is displayed as they usually allow the number of copies to be set.
Also be aware that once the print job has been handed over to Windows you can never be sure that is has been printed, e.g. the printer may be off-line causing the job to get stuck in the spooler and someone then deletes the print file from the spooler.
The code above is based on some post posted in this forum a long time ago.
Consider what may be easier for you to implement:
- To control sending prepared report from PreView to a printer.
- To control user access to the report, I mean after running a report once end user wouldn't be able to run it again.
Sure it depends on what do you really mean by "to print report only once" - sending it to printer or just running it (from a menu or so).
Regards
Mick