Report Print error

Hi, when i try to print one report i get this error…

Error:
Traceback (most recent call last):

  File "<event:actionPerformed>", line 1, in <module>

  File "<module:shared.report.difetti>", line 5, in printReportDifetti

NameError: global name 'event' is not defined



Ignition v7.9.4 (b2017082911)
Java: Oracle Corporation 1.8.0_151

I put this code in Global -> Script Library [shared] -> report -> Difetti

Code:
def printReportDifetti(id_roll, report):
	report = event.source.parent.getComponent("reportDifetti1")
	report.print()

And i try to call the function with Button:

Code:
shared.report.difetti.printReportDifetti("2", "s2355/reportDifetti")

You’ll have to pass the event variable as an argument to your report (shared.report.difetti.printReportDifetti). It is a local variable in the button script.

Thank you, but my printer doesn’t print anything…

I have resolve wih this script in Button Scripting…

Code:
report = event.source.parent.getComponent("Report Viewer")
report.print()

But how can i specify the report to print?
For example i have two line… The first report is called: S2355, the Second report is called: S3140
If i would to print the First report how can i change the script?