Search code examples
visual-foxpro

Slow printing in vfp using dot matrix printer (LQ-1170)


I know that this is an old topic for vfp programmers. Still, I want to ask for advices that can improve the printing time for my particular case.

I recently asked to change a report written in vfp. It use commands such as fputs, etc. The user prints this report in a dot matrix printer and of course : no problem. But the user asked for column addition and some complex calculation in the report. We tried to avoid paper size changes. So my initial solution was to rework the report using report designer, and set the page orientation to landscape. The result is so slow when printed.When I open the print queue, it even shows error - printing status!

I've tried to instal the printer driver in my local PC ( the machine where I compiled the exe) and selected this printer, both with 'save printer environment' checked and unchecked. Still the same result.

Any suggestions? Other tricks for my case are welcomed. Thanks in advance.


Solution

  • Sometimes, and not sure if its your case, when creating a report in VFP, it saves the printer environment based on the computer used to develop it (ie: your machine). To check, and since all reports are nothing but .DBF tables renamed, try the following. Open the report as a table

    USE YourReport.frx   (you have to explicitly include the .frx extension)
    BROWSE
    

    The first line in the report is your environment information that includes paper size info, orientation and even printer information. Double click in the column "Expr". The only things you probably need in this column are

    ORIENTATION=1 (or 0)

    it may have other stuff and look something like DRIVER=winspool DEVICE=\some\printershare OUTPUT=IP_192.168.1.22 ORIENTATION=1 PAPERSIZE=1 SCALE=100 ASCII=0 COPIES=1 DEFAULTSOURCE=15 PRINTQUALITY=600 COLOR=2 DUPLEX=2 YRESOLUTION=600 TTOPTION=3 COLLATE=0

    You can remove the rest of it. Next, close this column and tab over about 10 more columns to "Tag" and "Tag2". They are also MEMO type fields. Open them up. Remove ALL data out of these two columns... BUT ONLY FOR THE FIRST ROW!!!! If you open them, you would see more embedded stuff about the printer, just remove it completely. Do NOT do a global replace to blank for all rows as that will kill the report content... ONLY the first row.

    All this being said, I can't guarantee, but it may be the culprit... but then again, doing direct output on old dot-matrix printers might actually be faster than all the fancy rendering the printer drivers are doing.