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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Print A Page Range

Reports

How Do I Print A Page Range

by  dgrewe  Posted    (Edited  )
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
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top