Farhat Fakih


Hello all,

We are in the process of converting an old Foxpro 2.6 (DOS) software into VFP, the problem that we face is that the printing is very slow on dot-matrix printers We cannot shift to laser printer as the stationery is pre-printed and has to be multi-part.

Can anybody offer the solution

Thanks in advance





Re: Dot matrix printers with Visual Foxpro

Craig McGuff


Hi,
it's probably related to the fonts being used by the printer and/or single/double pass printing on the printer.
We are using an old DOS version of R&R reports (from micromega) for some dot matrix reports where speed is key.

Take a look at:
http://support.microsoft.com/kb/148348
http://fox.wikis.com/wc.dll Wiki~PrintingtoDotMatrixPrintersInTheirNativeFonts~VFP





Re: Dot matrix printers with Visual Foxpro

Lakshmi N

If u are using report writer, then definetly it will be very slow on dot matrix printer because windows uses pixels. if u want fast printing then u have to use a program to print to text files.

u can use commands like

set device to file outfl.txt

then use row and column position to print







Re: Dot matrix printers with Visual Foxpro

khubaib

i am using Epson lq-300+ii.(direct printing)

I want to print report only one line at page, and then print other line along. I do not want eject pages, i want to eject the page when all page print.

how it will be done.





Re: Dot matrix printers with Visual Foxpro

Lakshmi N

did not understand what u are telling. but if u want to print continuously and want to eject only at the end of reprot then

  • clos all
  • clear
  • set date brit
  • set cent on
  • set dele on
  • set talk off
  • set device to file cust.txt
  • nrou = 0
  • do printheader
  • sele 1
  • use customer
  • go top
  • do while !eof()
    • @ nrou,000 say custname
    • @nrou,040 say custid
    • @nrou,050 say location
    • nrou = nrou + 1
    • sele customer
    • if !eof()
    • skip
    • endif
  • enddo
  • nrou = 0
  • sele customer
  • use
  • modi comm cust.txt noed
  • set device to screen
  • procedure printheader
  • nrou = nrou + 1
  • @ nrou,000 say repli("-",80)
  • nrou = nrou + 1
  • @ nrou,000 say 'Customer Name'
  • @ nrou,040 say 'Customer ID'
  • @ nrou,050 say 'Location'
  • nrou = nrou + 1
  • @ nrou,000 say repli("-",80)
  • nrou = nrou + 1
  • return
  • cust.txt will eject only after printing the last page of the report

    how ever u want proper page breaks then

    • clos all
    • clear
    • set date brit
    • set cent on
    • set dele on
    • set talk off
    • set device to file cust.txt
    • nrou = 0
    • do printheader
    • sele 1
    • use customer
    • go top
    • do while !eof()
      • @ nrou,000 say custname
      • @nrou,040 say custid
      • @nrou,050 say location
      • nrou = nrou + 1
      • if nrou > 66
        • nrou = 0
        • do printheader
      • endif
      • sele customer
      • if !eof()
      • skip
      • endif
    • enddo
    • nrou = 0
    • set device to screen
    • sele customer
    • use
    • modi comm cust.txt noed
    • return
    • procedure printheader
    • nrou = nrou + 1
    • @ nrou,000 say repli("-",80)
    • nrou = nrou + 1
    • @ nrou,000 say 'Customer Name'
    • @ nrou,040 say 'Customer ID'
    • @ nrou,050 say 'Location'
    • nrou = nrou + 1
    • @ nrou,000 say repli("-",80)
    • nrou = nrou + 1
    • return





    Re: Dot matrix printers with Visual Foxpro

    khubaib

    thanks Lashmi your reply, your first report saying me cust.txt is read only when i run this.

    and scond is working well. but when print the report all page eject.

    acctuly my report is nog big than one line, when one line is print, i want printer stop after printng one line, than my next report which has alos one line, print with pervious line.

    thanks





    Re: Dot matrix printers with Visual Foxpro

    Aleniko

    If the printers are on a network, and you're trying to print from other machines, you can use "Set printer to \\machine\printer" and this will bypass any windows drivers and will send text directly to the printer. You will be able to use older reports in VFP keeping the same format.

    The problem with this method is that there is no way (At leas no way I'm aware of) to print to the local machine bypassing the windows print spooler. Even something like "set printer to LP1:" won't do that.

    Good luck.




    Re: Dot matrix printers with Visual Foxpro

    Lakshmi N

    Hai,

    cust.txt is read only because in the first program i just mentioned the code

    modi comm cust.txt noed (please remove the noed option)

    u can change it to print directly

    !type cust.txt > prn

    if u have only one record from various dbfs to be printed then follow the same technique

    assume u have cust.dbf, cust1.dbf,cust2,.dbf,cust3.dbf,cust4.dbf with 1 record each

    u can create a cursor and append all the records if all the dbf have same structure and print using program else

    • set device to file cust.txt &&this outputs the @ say commands to text file
    • nrou = 0 &&row positioning
    • sele a
    • use cust
    • go top
    • do printheader
    • do while !eof()
      • @ nrou,000 say custic
      • @ nrou,005 say custname
      • @ nrou,045 say location
      • nrou = nrou + 1
      • sele cust
      • if !eof()
        • skip
      • endif
    • enddo
    • set devi to screen
    • !type cust.txt > prn

    this will print cust.txt one line and there is no page eject character so printer will not eject to next page

    thanks

    (Lakshminarayana R)






    Re: Dot matrix printers with Visual Foxpro

    Darren5559

    hi,

    i have tried your solution, it works, but i have a small problem, i need to print chinese character, when i use !type text.file , i can see the chinese character, but when i type !type text.file > prn, chinese character become rubbish, could u help me on this is there any printer code allow me to print chinese character




    Re: Dot matrix printers with Visual Foxpro

    Lightening

    Open your word document, type some Chinese. See if you have fonts to select, like Kaiti, Songti.

    Try to send to your dotmatrix printer. If you cannot see regular characters, you have to install a Chinese software.

    Also test if you can print a Chinese document on a laser printer.





    Re: Dot matrix printers with Visual Foxpro

    Darren5559

    i am using VFP9 SP1 with epson printer, this is my code :-

    * ---- start
    LOCAL nRow
    nRow = 0
    nCounter = 0
    SET DEVICE TO FILE test.txt
    @ 0,0 say CHR(27)+"@"+CHR(27)+"M"
    FOR nRow = 1 TO 5
    nCounter = nCounter + 1
    @ nRow,10 say "ӡ : "+STR(nCounter)
    NEXT
    @ nRow, 0 say ""
    SET DEVICE TO SCREEN
    !type test.txt > prn
    * ---- end

    it works, but cannot print chinese, pls try and let me know





    Re: Dot matrix printers with Visual Foxpro

    Lakshmi N

    Hai

    use font with @ nrou,000 say

    eg.

    @ nrou,010 say 'Welcome' font 'Chinafont'

    where chinafont is the name of the chinese font

    but allignment may have some problems and this is only for checking purpose.






    Re: Dot matrix printers with Visual Foxpro

    Sachin K M

    Please help me, I am looking for codes that can skip 3 lines while encountering the perforation and re-position the header back in 1st row of next sheet!.

    Regards

    Sachin






    Re: Dot matrix printers with Visual Foxpro

    Aleniko

    You have a few options:
    Count the llines and once you get to the bottom of page, issue an EJECT or chr(12) command.
    Some printers have automatic skip over perforation options. You can turn it on.

    Alen.




    Re: Dot matrix printers with Visual Foxpro

    Lakshmi N

    suppose u have cust.dbf with the structure custcode,name,city and you want to print contiunously then

    private nrou

    nrou = 0

    set device to file cust.txt

    do printheader

    sele a

    use cust

    go top

    do while !eof()

    @ nrou,000 say custcode

    @ nrou,010 say custname

    @ nrou,052 say city

    nrou = nrou + 1

    if nrou > 66

    nrou = 0

    do printheader

    endif

    sele cust

    if !eof()

    skip

    endif

    enddo

    set device to screen

    !type cust.txt > prn &&output file

    return

    procedure printheader

    nrou = nrou + 1

    @ nrou,000 say replicate("-",80)

    nrou = nrou + 1

    @ nrou,000 say "Cust Code"

    @ nrou,010 say "Customer Name"

    @ nrou,052 say "Customer City"

    nrou = nrou + 1

    @ nrou,000 say replicate("-",80)

    nrou = nrou + 1

    return