Please help me how to reprint from the last line printed because my report is too long. I have to
put more papers in the pack (500 papers) and want to restart at last line printed.
Hi FoxTech,
You can adapt tesars suggestion of sending to a txt File.
If the printing crashes, start th text editor with this file and ptint starting from the page where it broke to end of file... using the print options of Windows.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK
Ive done this before but its kinda funky, load the report to a dbf (one line per record) use scan endscan to print the report. count the number of pages ejected and when you reach about 450 pages prompt the user in refill the paper tray.
Thats is the tricky part Usally i use around 60 lines per page but with a report generated by foxpro im not sure this will work (i use genecon printers with 64 char band so fancy print is never an issue with me).
by the way does anyone know where i can find shields for 20 year old line printers???
crea table myFile.dbf (print_row,C(254))
appe from myFile.txt type sdf
* you find position "Page xxx" in table
do while !("Page xxx" $ print_row)
dele
enddo
pack
copy to myFile.txt type sdf
copy file myFile.txt to LPT1
...or similarly (not tested)
table has one field as wide as your paper.
call it pages.dbf
*if you use this code send $1 to me (just kidding)
set printer to file <filename.txt>
set printer on
*report routine
set printer off
set printer to
use pages
append from <filename.txt> type sdf
printedpages = 0
scan
?pages.line
if mod(recno(),60) = 0 && page detect
eject
printedpages = printedpages+1
if printedpages = pagesinpapertray
wait "need more paper"
endif
endif
endscan
Two comments:
-command EJECT is redundant,
as is included in report.
- instead SET DEVICE TO PRINTER (infuence only @) use
set printer to LPT1, to output your printer,
not former file.
tesar is correct, you dont need set device to printer, you need to set printer on (sorry i left that out of my example)
also check your invent.txt to see if the report went there.
(i don't use report builder and am not sure what the text file will look like) you may want to check if it has eject symbol in the report if so tesar is correct about that too. and you will need to detect that character instead of mod(recno(),45)
ive used the same type of code on a hp laser jet 6 (nice little printer) the only differnce is you have to place an extra eject after the scan endscan or the last page will get "stuck" in the printer's memory.
make sure talk is set to off or you will print all your varibles to the printer
note you have set printpage to 2 was that just for debugging?
also instead of dele all and pack you could use zap?
the goal of any good engineer is to have a long career where nobody gets killed by his work.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.