# Save Report in Excel format type

**URL:** <https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428>\
**Category:** Ignition\
**Created:** [June 1, 2023, 10:17am UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428 "2023-06-01T10:17:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [June 1, 2023, 10:17am UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/1 "2023-06-01T10:17:56Z")

</div>

hi,  
i am trying to save my report data which is in tabular form.  
i am using the script on button :

import datetime  
time = datetime.datetime.now()  
tw = time.strftime("%Y-%m-%d %H:%M:%S")  
st = "Report " + str(tw)  
settings = {"path":"D:\Reports", "fileName":st, "format":"Xlsx"}  
system.report.executeAndDistribute(path= "event.source.parent.getComponent('Report Viewer').reportPath" , project="SPC\_SEFPRO", action="save", actionSettings=settings)

but i am getting an error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/09b4dd688d0a67ca73dcdcd269400d4c3f790ef8.png)

help me how to save my report in excel format.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 1, 2023, 10:19am UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/2 "2023-06-01T10:19:36Z")

</div>

> [@aman\_sharma](#):
>
> path= "event.source.parent.getComponent('Report Viewer').reportPath"

Don't put quotes around this.

---

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [June 1, 2023, 10:21am UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/3 "2023-06-01T10:21:24Z")

</div>

i tried but getting error : invalid file path

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 1, 2023, 10:38am UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/4 "2023-06-01T10:38:34Z")

</div>

\ is a special character. You either need to:  
Denote it as a raw string with `r"d:\hello"`  
Escape it with double backslash `"D:\\hello"`  
Use / instead `"D:/hello" `

---

<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:** [June 1, 2023, 12:24pm UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/5 "2023-06-01T12:24:09Z")

</div>

The `path` argument is the path to the report definition within the project, not a file path.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [June 1, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/6 "2023-06-01T13:24:43Z")

</div>

@aman_sharma please remove the report viewer path and put the report path see the below screenshot for more info also I have added a sample code.

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

```auto
settings = {"path":"C:\\IgnitionReportBackup", "fileName":"Report.pdf", "format":"xlsx"}
test = system.report.executeAndDistribute(path="report test",project="SPC_SEFPRO", action="save", actionSettings=settings)

```

---

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [June 1, 2023, 4:40pm UTC](https://forum.inductiveautomation.com/t/save-report-in-excel-format-type/74428/8 "2023-06-01T16:40:39Z")

</div>

thankyou!
