Dot matrix printers with Visual Foxpro  
Author Message
Farhat Fakih





PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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




Visual FoxPro1  
 
 
Craig McGuff





PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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

 
 
Lakshmi N





PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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



 
 
khubaib





PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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.


 
 
Lakshmi N





PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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 = 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 = nrou + 1
  • nrou = nrou + 1
  • 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 = 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 = nrou + 1
    • nrou = nrou + 1
    • nrou = nrou + 1
    • return


     
     
    khubaib





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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


     
     
    Aleniko





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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.

     
     
    Lakshmi N





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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

    • nrou = 0 &&row positioning
    • sele a
    • use cust
    • go top
    • do printheader
    • do while !eof()
      • 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)



     
     
    Darren5559





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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

     
     
    Lightening





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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.


     
     
    Darren5559





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

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

    * ---- start
    LOCAL nRow
    nRow = 0
    nCounter = 0

    FOR nRow = 1 TO 5
    nCounter = nCounter + 1


    SET DEVICE TO SCREEN
    !type test.txt > prn
    * ---- end

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


     
     
    Lakshmi N





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    Hai

    eg.

    where chinafont is the name of the chinese font

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



     
     
    Sachin K M





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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



     
     
    Aleniko





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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.

     
     
    Lakshmi N





    PostPosted: Visual FoxPro General, Dot matrix printers with Visual Foxpro Top

    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 = 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 = nrou + 1

    nrou = nrou + 1

    nrou = nrou + 1

    return