# Report Print error

**URL:** <https://forum.inductiveautomation.com/t/report-print-error/15894>\
**Category:** Ignition\
**Created:** [November 6, 2017, 2:35pm UTC](https://forum.inductiveautomation.com/t/report-print-error/15894 "2017-11-06T14:35:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsauna40](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lsauna40/32/4515_2.png) [@lsauna40](https://forum.inductiveautomation.com/u/lsauna40)\
**Post date:** [November 6, 2017, 2:35pm UTC](https://forum.inductiveautomation.com/t/report-print-error/15894/1 "2017-11-06T14:35:33Z")

</div>

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

```auto
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_

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

```

_And i try to call the function with Button:_

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

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 6, 2017, 3:14pm UTC](https://forum.inductiveautomation.com/t/report-print-error/15894/2 "2017-11-06T15:14:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lsauna40](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lsauna40/32/4515_2.png) [@lsauna40](https://forum.inductiveautomation.com/u/lsauna40)\
**Post date:** [November 6, 2017, 3:44pm UTC](https://forum.inductiveautomation.com/t/report-print-error/15894/3 "2017-11-06T15:44:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lsauna40](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lsauna40/32/4515_2.png) [@lsauna40](https://forum.inductiveautomation.com/u/lsauna40)\
**Post date:** [November 8, 2017, 9:23am UTC](https://forum.inductiveautomation.com/t/report-print-error/15894/4 "2017-11-08T09:23:45Z")

</div>

I have resolve wih this script in Button Scripting…

```auto
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?
