Trigger Report Without a Time-Based Schedule

I need to generate PDF reports at the end of a process, which can be run at any time of day. The way it needs to operate is that when an integer is above a set value, a report is generated and saved as a PDF somewhere in the file system, independent of the time.

I have a hacky way of getting the .saveAsPDF() function to trigger (system.gui.getWindow()), however this just brings up the dialog box for selecting a destination on the client, whereas I need the file fully generated without user input and stored on the server (or email or whatever, just something). I’ve also tried the print option and setting the default printer to PDF, but that printer driver still just brings up a dialog box and guess what, now the dialog is on the server instead of the client computer (if it works at all).

The scripting function system.report.executeAndDistribute() with the “save” action seems to fit your needs. Run it from a tag change event that monitors your trigger integer.

3 Likes

YES that’s exactly what I needed, thank you very much! You just saved my bacon.

Just tested it and yup this went off without a hitch. Thanks again!

Ha, what a coincidence, I was actually just looking for the same thing.
Thanks pturmel!!

1 Like