# Download report in PDF format Perspective

**URL:** <https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 23, 2024, 9:04am UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267 "2024-04-23T09:04:15Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [April 23, 2024, 9:04am UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267/1 "2024-04-23T09:04:15Z")

</div>

Hi guys,

I'm trying to download the report in PDF format with a button click in perspective.

In the gateway logs showing like the below:

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

Any idea what is wrong from my end?

```python
log = system.util.getLogger('Complex Order Pdf Request')
	reportPath = "DashboardReport"
	reportParameters = {'StartDate':self.view.custom.bindings.selection.dtStartDate, 'EndDate':self.view.custom.bindings.selection.dtEndDate, 'historyEnable':self.view.custom.bindings.calculations.DashboardData.showHistory}
	today = system.date.now()
	fileDate = system.date.format(today, "yyyy-MM-dd")
	settings = {"path":"C:\\", "fileName":"Report_"+fileDate, "format":"pdf"}
	
	windowsUser = system.util.getProperty("user.name")
	log.info(windowsUser)
	log.info(system.util.getProperty("user.home"))
	system.report.executeAndDistribute(path = reportPath, project = "Test", parameters = reportParameters, action = "save", actionSettings = settings)

```

Thanks,  
Priyanka

---

<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:** [April 23, 2024, 11:56am UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267/2 "2024-04-23T11:56:19Z")

</div>

Don't use `system.report.executeAndDistribute()`. You need to use `system.report.execute()`, capturing the bytes it returns, and then use `system.perspective.download()`.

---

<div class="post-metadata">

**Author:** ![Kuldeep\_Pawar](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kuldeep_pawar/32/44736_2.png) [@Kuldeep\_Pawar](https://forum.inductiveautomation.com/u/Kuldeep_Pawar)\
**Post date:** [May 2, 2024, 12:37pm UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267/3 "2024-05-02T12:37:59Z")

</div>

Hi, following to this we have used `system.report.execute()` and `system.perspective.download()`. We were able to download report in downloads folder. But user wants it in specific folder, is there any way to achieve this?

---

<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:** [May 2, 2024, 12:41pm UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267/4 "2024-05-02T12:41:29Z")

</div>

Not from the Ignition side. The user has to tell their browser to not automatically use the downloads folder, but to ask every time. Then they can pick where to put the file, and substitute a different file name if they want. For security, this absolutely must involve the user.

(Controlling where and what name to use from the Ignition side would be something malware does, and if you did find a way, browser makers would quickly try to plug that security hole.)

---

<div class="post-metadata">

**Author:** ![Kuldeep\_Pawar](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kuldeep_pawar/32/44736_2.png) [@Kuldeep\_Pawar](https://forum.inductiveautomation.com/u/Kuldeep_Pawar)\
**Post date:** [May 2, 2024, 12:47pm UTC](https://forum.inductiveautomation.com/t/download-report-in-pdf-format-perspective/89267/5 "2024-05-02T12:47:27Z")

</div>

Got it. Thanks for your reply 😃
