# Scripting Functions (system.report.executeReport)

**URL:** <https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 24, 2025, 12:02pm UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132 "2025-08-24T12:02:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jianzang1125](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jianzang1125/32/78938_2.png) [@jianzang1125](https://forum.inductiveautomation.com/u/jianzang1125)\
**Post date:** [August 24, 2025, 12:02pm UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/1 "2025-08-24T12:02:07Z")

</div>

Hi,

I did test the **system.report.executeReport()** function based on the tutorial [Scripting Functions Video at Inductive University](https://inductiveuniversity.com/videos/scripting-functions/8.1)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2f5f6d84577c64e848ffdf52148ce42c372dc30.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/28a2ef08879136ec6b01f7d8d1f9ce7d96b89760.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/818249d78fe298a9ab4e36375c9107269a6065a2.png)

Can anyone guide me any mistakes I made, thanks.

Regards

Jian

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 24, 2025, 12:29pm UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/2 "2025-08-24T12:29:48Z")

</div>

Does you report work in preview mode? Is there data shown on the report? Any errors in the diagnostic console for the designer?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [August 24, 2025, 11:11pm UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/3 "2025-08-24T23:11:53Z")

</div>

It’s possible MyReport is unsaved (based on it being in italics)... I would save and close all windows and try again. Reports and Named Queries sometimes need some extra saves for changes to take effect throughout.

---

<div class="post-metadata">

**Author:** ![jianzang1125](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jianzang1125/32/78938_2.png) [@jianzang1125](https://forum.inductiveautomation.com/u/jianzang1125)\
**Post date:** [August 25, 2025, 12:18am UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/4 "2025-08-25T00:18:34Z")

</div>

Hi, Mate

I ran the script in the Script Console and followed the tutorial exactly, but I'm still encountering issues.

MyReport got nothing to configure except an empty parameter –‘functionName’

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/21e7877c3b7c506b32f51c592ad771ccc31666d4.png)

I guess this error is fine. I have configured the event in the button.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58de74dd73a78c62f45e949303d17bf921fc076f.png)

BTW, I put my code below for your trial.

```python
reportBytes = system.report.executeReport(path='MyReport',project='myProject',\
	parameters={'functionName': 'Using executeReports()'}, fileType='pdf')
name = "executeReport() Report"
event.source.parent.getComponent('PDF Viewer').loadPDFBytes(reportBytes,name)

```

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 25, 2025, 12:23am UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/5 "2025-08-25T00:23:45Z")

</div>

The report itself, is there data in it? When you run the report in preview mode in the designer is there data showing in the report?

---

<div class="post-metadata">

**Author:** ![jianzang1125](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jianzang1125/32/78938_2.png) [@jianzang1125](https://forum.inductiveautomation.com/u/jianzang1125)\
**Post date:** [August 25, 2025, 12:24am UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/6 "2025-08-25T00:24:50Z")

</div>

> [@code\_skin](#):
>
> based on it being in italics

Hi, Mate.

No, I did save it. It’s an empty report.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/5/1562dc329a3f7bfa59c1755b49e97c11854bdbd7.png)

But when I switch to the window, the text became italics again.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/2/4275673310fd32c4fc45518068c9d1b92fe88f60.png)

I have pasted the code below; you can change the project name accordingly and try it in your software.

```python
reportBytes = system.report.executeReport(path='MyReport',project='myProject',\
	parameters={'functionName': 'Using executeReports()'}, fileType='pdf')
name = "executeReport() Report"
event.source.parent.getComponent('PDF Viewer').loadPDFBytes(reportBytes,name)

```

Thanks.

Jian

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 25, 2025, 12:54am UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/7 "2025-08-25T00:54:51Z")

</div>

If the report is empty... Then it might be showing the report. Just empty.

Add some static text or something to the report then you can tell if you are generating the report.

---

<div class="post-metadata">

**Author:** ![jianzang1125](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jianzang1125/32/78938_2.png) [@jianzang1125](https://forum.inductiveautomation.com/u/jianzang1125)\
**Post date:** [August 25, 2025, 8:18am UTC](https://forum.inductiveautomation.com/t/scripting-functions-system-report-executereport/110132/8 "2025-08-25T08:18:32Z")

</div>

Hi, Mate

It works. Thanks 🙂

👍

Regards

Jian
