I'm using ignition 7.9.19 with the goal of using a single button press to print a report from a client window.
I've realized the system.report.executeAndDistribute function executes on the gateway, this wont work for me.
I've tried using system.print.createPrintJob but it looks like it only accepts components, and when printing a report viewer or pdf viewer it includes the extra controls or borders of the component, rather than just the report. I'm printing on a small label so the space this uses makes this solution unsatisfactory.
I've tried combining system.report.executeReport and system.file.writeFile to either an image or a pdf. I was able to import the image as a component and print that but it introduced some unsatisfactory quality issues I haven't been able to resolve. I haven't found a way to import a pdf directly as a component or print a file from the hard drive.
Thanks in advance for any suggestions and support
You should be albe to go this route:
event.source.parent.getComponent('Report Viewer').print()
This method only prints a small clipped portion of the report for me, even when printing to pdf. Does the .print() accept any arguments?
I'd also like to avoid a print dialogue if possible, which seems possible using other methods
If it truncates like that, it may be a margin setting in the report.
Indeed it was the margin settings. It's printing out how I'd hope for now! Thanks!
Updating this as I've ran into a new question / problem in my development.
Some more context, I want to allow users to select multiple rows from a table and print off a report using data from each row. I'm using a for loop and have tried a couple methods of passing in the data, but using the reportViewer doesn't seem to work fast enough as I get multiple copies of the same data (either the data from the last print attempt or the first row of the table.
How can I print the byte array returned from system.report.executeReport?