Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record printout of Report

Status
Not open for further replies.

mstrcmtr

Programmer
Nov 14, 2007
103
PK
How can record that printout of Report e.g. (Sale order or Invoice) through Print button of Print tool bar ?

Sometime only user view print preview of Report and NOT print the report only want to record the print out of report
 
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.

Bye, Olaf.
 
Want to Record beacsuse sometime more than 1 user take printout of same order or invoice
 
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)

Done.

Bye, Olaf.
 
You can also remove the print button from the toolbar, eg see Knowing the print toolbar has it's setup in foxuwser.dbf you also can find it and manipulate it differently.

But in the end clicking that button from a preview doesn't ensure it's really printed because of many problems, which might occur on the way out.

Bye, Olaf.
 
To summarise, I suggest something like this:

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)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top