Report Print error

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

Traceback (most recent call last):

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

  File "<>", 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

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

And i try to call the function with Button:

Code:"2", "s2355/reportDifetti")

You’ll have to pass the event variable as an argument to your report ( 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…

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

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?