Print an external file using a Codeunit???

NAV_DynamicsNAV_Dynamics Member Posts: 7
Hi Guys,

How to print an external file using a codeunit in Navision.
On executing the codeunit, the location of the file should be fetched from
a table and the file should be printed.
Any ideas how to do this????

Regards
NAV_Dynamics

Comments

  • flfl Member Posts: 184
    It depend of course on which type of files you want to print. If it is really mentioned as many types as possible, I suggest to use a viewer. I use for this reason RxView. With this viewer you can open many files (office, txt, bmp,jpeg,...,autocad,inventor,solidworks,...). If you buy (not for free) the activex, then you can build a program to open and print your file. This program can then be called from your codeunit. I use it in a simular way for a document management solution.
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • NAV_DynamicsNAV_Dynamics Member Posts: 7
    Only TXT file needs to be printed. We are attempting to send the file to a printer through code.Thinking of using the Automation server or OCX controls....
  • flfl Member Posts: 184
    In DOS you can print a txt file very easily:

    copy file.txt >lpt1:

    The > is the redirection sign, to move that file to the lpt1 port

    You could try to use that command right out of navision.
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • NAV_DynamicsNAV_Dynamics Member Posts: 7
    I am getting the Messaage the 'File is currently being Printed'. But it is not...

    Let me see any thing else that can be done....

    Thanks and Regards,
    Jayakumar
  • Morten_SolbergMorten_Solberg Member Posts: 24
    try this code:
    Return := SHELL('notepad.exe /p C:\myFile.txt');
  • NAV_DynamicsNAV_Dynamics Member Posts: 7
    This is working Fine.....

    Thanks and Regards,
    Nav_Dynamics
Sign In or Register to comment.