On 5/13/14, 12:11 PM, Ted Roche wrote:
A client has a situation where they want to print two different preprinted
forms and collate the result, something like:
Tray 1: blue copy of paycheck
Tray 2: canary statement of earnings
The well-known VFP trick is to establish two different reports and in
Windows create two different named printer profiles and then alternate:
DO WHILE NOT DONE
REPORT FORM Paycheck TO PRINT PRINTER 'BlueTray' NEXT 1
SKIP -1
REPORT FORM Statement TO PRINT PRINTER 'CanaryTray' NEXT 1
ENDDO
or similar pseudo-code. Works great, right up to the point that it don't.
The statement is an intricate document with lots of curliques and takes
longer to print than the paycheck, so what we end up getting out of the one
output tray is:
Paycheck1
Paycheck2
Statement1
Paycheck3
Statement2
Paycheck4
Paycheck5
Statement3
and so on. Since the two printer queues are unrelated, there's no
coordination between the two.
A search of the Leafe.com archives and Fox Wiki didn't turn up anything
promising.
Before I hack at this myself, wondered if anyone else had run into the
problem and found an elegant solution, like using PRINTJOB or something.
VFP9SP2+, Windows 7 and later, printer of unknown brand.
I think you are going to need to control the print queue low-level,
using functions like:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd162861(v=vs.85).aspx
But maybe you could low-tech it if you don't mind waiting longer than
needed by adding a sleep(10) between each job, to allow the prior
printout to complete. Better, make that sleep time configurable by the user.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.