Why not print to PDF by using a PDF printer driver (i.e. PDFCreator) or if it's simple text, print to file (ascii) (REPORT FORM...TO FILE your.txt)?
And why print at all? If a user wants to work on a record or copy it, normal data bound forms are there to work with data.
Ah, sorry, you want to count how many times a reocrd was printed. Well, that's almost impossible, as you can't know whether a printout is really done successful. Even if you distinguish closed preview from final printout, you don't know how many times the printout comes out white because of low ink/toner or paperjam.
If you want to assure an order only is printed once, give it a status:
1. Status starts with "not printed" (1)
2. Set status to "will be printed" (2) before printing when a user selects it for printing.
Records with that state will already not be available to further users unless the user printing sets it back to "not printed" (1)
3. Once printed ask the user to confirm the print and set the status to "printed" (3), when they don't confirm set it back to "not printed" (1)
1. Remove the Print button from the Preview toolbar - see the link posted by Olaf above.
2. In your sales orders, invoices, etc. tables, add a logical field to say if the document has been physically printed yet (as per Olaf's suggested Status field).
3. When a user wants to print an order (or whatever), check the Status flag to see if it has already been printed. If not, execute a [tt]REPORT FORM .... TO PRINT[/tt] command. Then set the flag to say it has been printed. If it has already been printed, tell the user that he cannot print it again.
That just leaves the question of what to do about a failed printout, such as a paper wreck. For that, you can give a special privilege to a supervisor that will allow him to reset the status flag. And perhaps automatically keep a log of all instances when that is done.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.