# system.report.executeAndDistribute()... Does it work in Linux?

**URL:** <https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573>\
**Category:** Ignition\
**Created:** [January 12, 2018, 1:02pm UTC](https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573 "2018-01-12T13:02:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricFrancoeur](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@EricFrancoeur](https://forum.inductiveautomation.com/u/EricFrancoeur)\
**Post date:** [January 12, 2018, 1:02pm UTC](https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573/1 "2018-01-12T13:02:22Z")

</div>

Hello, I’ve sent this to support yesterday and no response yet… Just my totalcare notice that it’s due end of March… Kinda frustrating…

Anyway,I’ve tried :

system.report.executeAndDistribute(path=“Ticket DO2”, project=“NotcheuseSMI”, action=“print”, actionSettings = {“primaryPrinterName”:“SMITicket”}) on a Tag Change script. I have no error but it doesn’t print nothing. on my gateway server, nothing in print queue.

I’ve tried the script from [Printing report to networked printer](http://forum.inductiveautomation.com/t/printing-report-to-networked-printer/16097/2) I’ve modified it to put the output to temp file because I don’t think there is a console for gateway scripts as follow:

from javax.print import PrintServiceLookup as PSL

printerList = PSL.lookupPrintServices(None, None)  
defaultPrinter = PSL.lookupDefaultPrintService()

tempFile = system.file.getTempFile(“txt”)

for printer in printerList:  
system.file.writeFile(tempFile, printer.getName(), 1)

The file was empty. The only possible reason that I can see is that the printer was just created and I need to reboot server or service? Since it’s a pain to reboot this server, I want to ask first, if it will help my cause. Or is there another reason?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [January 12, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573/2 "2018-01-12T15:32:15Z")

</div>

To answer the title of your question, yes executeAndDistribute works on Linux.

Based on the text of your question, the real issue is that Java isn’t seeing your printer. After googling for a bit, it looks like you might be hitting a known Java issue – the work around is to reboot, open the printers control panel, and then start Ignition. Unfortunately, if Java can’t see the printer, then neither can Ignition. :\

---

<div class="post-metadata">

**Author:** ![EricFrancoeur](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@EricFrancoeur](https://forum.inductiveautomation.com/u/EricFrancoeur)\
**Post date:** [January 17, 2018, 7:03pm UTC](https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573/3 "2018-01-17T19:03:29Z")

</div>

Reboot and/or restarting the program didn’t fix it. What is happening is that JAVA needs ‘/usr/bin/lpr’ as stated for this application (What ever it is.) :  
[https://www.mathworks.com/matlabcentral/answers/102504-why-do-i-receive-a-java-printerioexception-when-i-try-to-print-from-of-one-of-the-desktop-windows-on?requestedDomain=true](https://www.mathworks.com/matlabcentral/answers/102504-why-do-i-receive-a-java-printerioexception-when-i-try-to-print-from-of-one-of-the-desktop-windows-on?requestedDomain=true)

So it’s either the lpr is somewhere else, and you need to create a symlink lpr to the actual location of lpr, or in my case, just nowhere to be found. Doing sudo apt-get install lpr will install a lpr, but that one will not work, as stated here:

> <https://askubuntu.com/questions/584047/lp-works-but-lpr-does-not>

So the fix was sudo apt-get install cups-bsd

---

<div class="post-metadata">

**Author:** ![EricFrancoeur](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@EricFrancoeur](https://forum.inductiveautomation.com/u/EricFrancoeur)\
**Post date:** [November 16, 2018, 12:38pm UTC](https://forum.inductiveautomation.com/t/system-report-executeanddistribute-does-it-work-in-linux/16573/4 "2018-11-16T12:38:37Z")

</div>

To add to this solution, further down the road you might get a problem with the printer giving you a media error when you try to print. The solution is to force the driver to RAW with:

```auto
sudo lpadmin -p <PrinterName> -m raw

```

then in cups [http://localhost:631/admin](http://localhost:631/admin)  
modify the printer with the Zebra ZPL driver again.

In some instance I had to reboot the server, and sometimes not. Guess it’s because I haven’t cancelled the print job in the queue before starting the procedure.
