FPD Print the report to a text file * Define an invisible window to accept report output. define window _PRINT at 0.000, 0.000 size 5,100 title 'Printing' activate window _PRINT noshow PAGELAST=0 repo form FOO PAGELAST=_PAGENO rele window _PRINT * Now print for real, using m.PAGELAST in the footer. repo form FOO noconsole to print prompt ___________________
This works great, except for the "prompt" in the second report, which lets them pick the printer. The printer they pick, such as a fax driver, sometimes has a different number of pages from the default printer. So the code above calculates m.PAGELAST with the default driver, but then the user prints to the fax, and m.PAGELAST is no longer accurate.
The solution seems to be to run sys(1037) at the very beginning of the above code. That way, m.PAGELAST would be calculated in the "dry run" with the same print driver that will be used when it actually prints. But after printing, I want the program to set Foxpro's default printer back to what it was. I tried using sys(1037) after printing, and stuffing the keyboard buffer with Alt+D and Enter, but the dialog ignores the keyboard buffer.
FPW Interactive mode - add the prompt parameter to the report form command unattended mode - Use DOS method.
VFP Interactive mode - add the prompt parameter to the report form command unattended mode1 - Add the RANGE parameter to the report form command unattended mode2 - Use Dos Method