web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Problem when Printing a EPL file

(0) ShareShare
ReportReport
Posted on by 225

Hi everyone,

I'm generating an EPL file in one directory, and trying to print it, bit I finde the next error:

inglersd.png

"There os no associated application with the specified file for this operation"

The file is generated correctly, with this code:

   lShipment.CALCFIELDS(EPL);
   lTmpBLob.Blob := lShipment.EPL;
   lTempServerFileName := lFileManagement.ServerTempFileName('.EPL');
   lFileManagement.BLOBExportToServerFile(lTmpBLob,lTempServerFileName);
   FileNameServer := '\\SRV-DC01\navision\XML\Pegatinas\'+lShipment."No."+'.EPL'; 
   lFileManagement.DownloadToFile(lTempServerFileName,  FileNameServer);


And I'm trying to print it this way:

   IF ISNULL(ProcessStartInfo) THEN
     ProcessStartInfo := ProcessStartInfo.ProcessStartInfo;
   ProcessStartInfo.UseShellExecute := TRUE;
   ProcessStartInfo.Verb := 'Print';
   ProcessStartInfo.WindowStyle := ProcessWindowStyle.Hidden;
   //seleccionar impresora
   ProcessStartInfo.Arguments :='Etiquetas Expediciones 2';
   ProcessStartInfo.FileName := FileNameServer;
   Process.Start(ProcessStartInfo);
   Process.Close;

This are the involved variables
ProcessStartInfo    DotNet    System.Diagnostics.ProcessStartInfo.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'    
ProcessWindowStyle    DotNet    System.Diagnostics.ProcessWindowStyle.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'    
Process    DotNet    System.Diagnostics.Process.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'   

What could be the problem? I'm trying different options, but I can't finde the correct way,

Any hint will be really appreciated

*This post is locked for comments

I have the same question (0)
  • jgaztanaga Profile Picture
    225 on at

    Seems to be an issue with the EPL, if I create the file in text mode, I don't get the error...

  • Hannes Holst Profile Picture
    5,767 on at

    Hi,

    You must apply a Standard Application for the file type EPL and the machine your code is executed (on the client or on the server?)

    This must be done in Windows. The way to do it differs from version to version: www.howtogeek.com/.../how-to-set-your-default-apps-in-windows-10

    The code below basically emulates as you as a user would click with the right mouse button on that file and select "Print" from the context menu.

       IF ISNULL(ProcessStartInfo) THEN
         ProcessStartInfo := ProcessStartInfo.ProcessStartInfo;
       ProcessStartInfo.UseShellExecute := TRUE;
       ProcessStartInfo.Verb := 'Print';
       ProcessStartInfo.WindowStyle := ProcessWindowStyle.Hidden;
       //seleccionar impresora
       ProcessStartInfo.Arguments :='Etiquetas Expediciones 2';
       ProcessStartInfo.FileName := FileNameServer;
       Process.Start(ProcessStartInfo);
       Process.Close;


  • jgaztanaga Profile Picture
    225 on at

    Hi Hannes, thanks for your tip.

    What type off aplication should I USe as default one?

    As you say about the right click, I've noticed that if I right click the EPL file, I don't have the print option. I understand that this issue will be solved adding the default app, am I right?

    edit:

    I've configured Notepad++ as the default app:

    defaut.png

    But I still have the same problem, and still don't having the "Print" button when i right-click on the file.

    Should I restart the server?

    Than you, really appreciate your help

  • Hannes Holst Profile Picture
    5,767 on at

    You must select a program which is able to handle EPL-files.

  • jgaztanaga Profile Picture
    225 on at

    I've tried with this one:

    www.freefileviewer.com

    And still having the same problem.... Don't find the "Print" option...

  • jgaztanaga Profile Picture
    225 on at

    I'm trying to first print the epl file from commnad line yo see if it's correct, but I'm not able to do it. I'm trying like this:

    NET USE  192.168.2.185_6: "\Etiquetas Expediciones 2"  /persistent:yes 
    PRINT /D:192.168.2.185_6 C:\XML\ENVIALIA\Pegatinas\ENV18-000059.epl

    or

    COPY  /B C:\XML\ENVIALIA\Pegatinas\ENV18-000059.epl 'Etiquetas expediciones 2'


    But I'm not able. Ther printer is configured in the server like this:

    printer.png

    How should I do it? I'm quite lost...

  • jgaztanaga Profile Picture
    225 on at

    Hi Hannes Holst,

    May be could be an issue with the drivers?

    Thank you

  • Hannes Holst Profile Picture
    5,767 on at

    You need an application which is able to open and print EPL-files.

    It's the same for PDF: You need an application to open and print pdf-files.

    If this is not possible, you must consider to generate another file type than EPL.

  • jgaztanaga Profile Picture
    225 on at

    Thanks Hannes, At first, the development was in PDF, but we need to change it becasue system provider's requirements. I understand perfectly what you're saying, but..

    Which application can dothat? I've tried with 2 different ones, but seems not to be the correct ones...

    Realy appreciated your tips

  • Hannes Holst Profile Picture
    5,767 on at

    I assume EPL is for a barcode printer.

    Have a look for the documentation of your printer model to find out how to send EPL-files to the printer directly.

    Never did it that way, but I think they provide normally small command line tools or a .NET-integration to communicate with the printer directly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans