Ignition Reporting - Print Action

Hi All,

Will the snippet below work? We need to print the report at the same time with two different printers.

What is the purpose of Backup Printer? Is it when the Primary Printer fail to print?

Hope this will help.

https://docs.inductiveautomation.com/display/DOC81/Scheduling+Actions#:~:text=Backup%20Printer,Printer%20fails.%20[Optional]

1 Like

Hi Learner_Ignition,

Ahh, I see. I should put an action setting on my script and add the names of the printer. Thanks a lot!

Have a great day!

JR

Hi Learner_Ignition,
I am trying to print report by using below script but its not working and also not getting any response in return. can you please provide a format to send a print to the printer.

----------Printing Script-----------
params = {'partNumber': '',
'packingCode': '',
'quantity': '',
'partDescription': '',
'customerPartNo': '',
'warehouseno': '',
'packingDescription': '',
'containerSerialNo':str(''),
'workorderNo': '',
'Destination': '',
"VER":"VER",
'VERC2': "VERC2"
}
path='EDE_TransportLabel'
project='myproject'
action='print'
settings={"primaryPrinterName":"myprinter","backupPrinterName":"myprinter","copies":1}
#settings = {"path":"D:\", "fileName":"EDE_TransportLabel.pdf", "format":"pdf"}
saveresult = system.report.executeAndDistribute(path=path,parameters=params,project=project, action=action, actionSettings=settings)
print(' Report Print: '+str(saveresult))

If it's not working, the most likely culprit could be that if you're trying to execute this from the gateway and if you're using Windows, the user the Ignition service is running under (typically SYSTEM by default) needs to have those printers installed and available to it. SYSTEM does not have any printers and you'll need to create a unique user with appropriate permissions that has permission to run services that Ignition will use instead of SYSTEM. You'll need to change this on the Ignition service to use this new user, then you'll want to login with that user and configure the printer(s) you need. Once that's done, you'll probably have to restart the Ignition service to pick up those printers, and hopefully it starts working then.

Hi michael.flagler,
the printer is installed on the gateway server and i am able to print from pdf readers. but while executing the below script the print is not working also not able know where is wrong.if you are having a sample script for reference please share .


params = {'partNumber': '',
'packingCode': '',
'quantity': '',
'partDescription': '',
'customerPartNo': '',
'warehouseno': '',
'packingDescription': '',
'containerSerialNo':str(''),
'workorderNo': '',
'Destination': '',
"VER":"VER",
'VERC2': "VERC2"
}
path='EDE_TransportLabel'
project='myproject'
action='print'
settings={"primaryPrinterName":"myprinter","backupPrinterName":"myprinter","copies":1}
#settings = {"path":"D:\", "fileName":"EDE_TransportLabel.pdf", "format":"pdf"}
saveresult = system.report.executeAndDistribute(path=path,parameters=params,project=project, action=action, actionSettings=settings)
print(' Report Print: '+str(saveresult))

Is the PDF reader running under SYSTEM?

Printers are not "computer" based resources. They are user-based, so each user must have the printer set up under their account/profile. The default SYSTEM or "Local System" user won't have any printers even if you installed them under your login, which is why you have to create a special login for the Ignition service to run under and configure the printer(s) under that account.

Yes its working