Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternative to shellexecute
Message
 
 
To
01/04/2010 12:21:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01458403
Message ID:
01458407
Views:
89
Check this thread Re: Skipping and dups when printing fillable pdfs Thread #1456159 and especially Christof's message in it.

>I'm using ShellExecute to print PDF forms from a desktop application written in VFP9. The requirement is for the program use the PDF appointment of agent (AOA) forms as cover sheets between sections of Fox reports. I segregated the reporting like this:
>
>
>Set Printer To Default
>Select Distinct st, cnty, system ;
>	FROM Work Into Cursor mygroups
>
>
>
>Select mygroups
>Scan
>	This.printcover(mygroups.System)
>*	sleep(10000)
>	Select * From Work ;
>		INTO Cursor mywork;
>		where (System == mygroups.System);
>		AND (st == mygroups.st);
>		AND (cnty == mygroups.cnty);
>		ORDER By st, cnty, System, acct
>
>	Select mywork
>	Set Relation To (st+cnty) Into tunits Additive
>	Set Relation To System Into bankname Additive
>
>	Report Form pde1 Noconsole To Printer
>Endscan
>
>
>Where the PrintCover method does the call to shellexecute:
>
>
>Lparameters cSys
>Local cfile, loException
>cfile = cSys+[ TX.pdf]
>
>Try
>	This.shellexecute(cfile,[T:\AOA\Real Estate - Texas],[print])
>Catch To loException
>Endtry
>WAIT [Printing AOA ...] WINDOW TIMEOUT 10
>
>I have inserted a 10 second delay to try to alleviate a problem where the fox report section gets to the print queue faster than the PDF that should precede it.
>
>Is there another method of shelling out that allows the fox program to wait for the outside call to complete? I believe it may be done with ShellExecuteEX(), but it would be great if an example can be found for me to study.
>
>thanks
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform