Send a simple text to a printer

philippegirodphilippegirod Member Posts: 191
To print to a barecode printer, I need to send to it a simple text from Navision.

I tried the next :

1/ Suppress the margins, and have only one textbox in one section : the printer can't print

2/ create a text file and send it to the printer thrue SHELL command : my printer driver dosen't run in DOS mode..


Anyone have an idea ?

Thanks to all...
My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Have you a printer-driver for that printer?

    You can also use the generic printer-driver and print the text.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • philippegirodphilippegirod Member Posts: 191
    Yes, I have an XP driver for that printer.

    When i print the text from notepad => OK
    From wordpad => the printer can't print
    from Navision => the printer can't print
    From a DOS COmmand => the printer can't print
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • ShenpenShenpen Member Posts: 386
    Have tried
    SHELL('copy simple.txt LPT1:');
    
    ? The " : " is important.

    This is how I use a Zebra printer.

    Do It Yourself is they key. Standard code might work - your code surely works.
  • ShenpenShenpen Member Posts: 386
    The DOS command should always work, I think if it does not work is a different kind of problem, because it is very low level. Check whether you have an LPT1 installed in Windows printers. What I usually experienced is that you Zebras are sensitive to turn in order - I mean turn on the PC first and the Zebra later.

    Do It Yourself is they key. Standard code might work - your code surely works.
  • kinekine Member Posts: 12,562
    If you have problems with sending raw data to your printer, you can use this:

    http://www.mibuso.com/dlinfo.asp?FileID=341

    :-)

    But as Shenpen wrote, it seems that you have another problem... but I do not know which printer you are using...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • easabanganeasabangan Member Posts: 114
    Do you send printer commands to the printer?
    Because sometimes it causes error to the printer. Printer will not print even when you send commands through the DOS like "ECHO Hello World > LPT1". If you are sending commands to printer then you must test every commands that you pass to it, test the commands if it is executed properly to the printer.
    No future at CPI
  • skyggemanskyggeman Member Posts: 5
    Hi all

    We have a problem printing from Navision through a network printer (Zebra 2844 EPL) ](*,) :-k

    Does anyone know how to write a command that will copy a .txt-file to this network-printer ?????

    TY :mrgreen:

    /Skyggeman
  • kinekine Member Posts: 12,562
    What kind of problem?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • skyggemanskyggeman Member Posts: 5
    Hi

    We can not print using the following command: ](*,)

    shell('command.com' , '/c' , 'copy c:\filename.txt \\server\printername');

    Can you help =D> :mrgreen: :?:

    /Skyggeman
  • krikikriki Member, Moderator Posts: 9,118
    Does it give an error?

    If not, maybe you should try to send a FF-char (=FormFeed=ASCII 12) to the printer.
    You might also try to use the PRINT command.
    You might try to connect the printer to LPT1 and use copy [file] Lpt1:
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    This is tested and working:
          devnull:=SHELL('c:\winnt\system32\cmd.exe',
                        '/C copy '+CompanyInfo."Barcode Export Dir" +'\labels.txt ' +
                        'LPT1');  
    
    

    I am storing the return value in a variable to make it run modally (i.e. to make the Navision code wait until finished). Maybe this is your problem. Make sure all SHELL calls are modal this way.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    I am not sure a network printer \\server\printer can be printed to directly with a DOS copy the same way as LPT1.

    Besides, isn't there a proper software for Zebra which can import exported data?
  • philippegirodphilippegirod Member Posts: 191
    We used the next method to send data to a barcode printer wich can read only text files :

    1/ we build the text file from navision
    2/ we write a batch file
    3/ we execute this batch file within Navision

    the text in the batch file is something like :
    echo PRINT \\disk\directory$\filetext.txt D:\\printerserver\printername

    I know, there is obviously an easier method... this is only a way to do..
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Rather COPY than PRINT I think.

    Besides, exactly the same way of thinking than mine :) And of course, your batch file is also self-deleting, like mine, hm? :)
  • philippegirodphilippegirod Member Posts: 191
    Yes, copy is better....
    And we delete all file after the job.
    My candle burns by both ends, it will not last the night,
    But oh my foes and oh my friends, it gives a lovely light
  • jayasankarprkjayasankarprk Member Posts: 1
    Dear All,

    I Place a button control in the Item card form. I want to send the Item
    number directly to the BarCode printer and take the print out.Its a Network
    Printer and port is LPT1.Priner is ZDesigner TLP 2844.

    What we do for this.Pls help me....

    regards,
    Jayasankar
Sign In or Register to comment.