I have run across an issue with an client script used to automatically print a report at midnight. The script is defined below:
name = system.security.getUsername()
if name == ‘admin’:
window = system.gui.getWindow(“Advanced/Totalizers”)
job = system.print.createPrintJob(window)
job.showPrintDialog = 0
job.fitToPage = 1
job.orientation = system.print.LANDSCAPE
job.showPageFormat = 0
When the script is triggered, the printout is blank unless I change the job.showPrintDialog to = 1. This makes it so that the user has to interact to get it to print.
I want the printout to work without user interaction. I have tried using import time, and time.sleep(3) after defining the job, but it still comes out blank.
What can I do to get this working without having job.showPrintDialog = 1? Invokelater?