# How to save or print Report using Perspective module?

**URL:** <https://forum.inductiveautomation.com/t/how-to-save-or-print-report-using-perspective-module/32048>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [February 7, 2020, 3:30pm UTC](https://forum.inductiveautomation.com/t/how-to-save-or-print-report-using-perspective-module/32048 "2020-02-07T15:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [February 7, 2020, 3:30pm UTC](https://forum.inductiveautomation.com/t/how-to-save-or-print-report-using-perspective-module/32048/1 "2020-02-07T15:30:23Z")

</div>

I am new to perspective and ignition. I am facing problem with saving report on button click. I tried all the different ways given in forum and YouTube. I created a report named “ExpenseReport” and a view with pdf viewer and a button and in button onclick event I wrote the following code:

settings = {‘path’:‘C:\Reports’, ‘fileName’:‘ExpenseReport.pdf’, ‘format’:‘pfd’}  
system.report.executeAndDistribute(path=‘ExpenseReport’, project=‘TimeSheetV3’, action=‘save’, actionSettings=settings)

I don’t know where I am doing wrong.

I am using Ignition 8.0.7

Thank You.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 7, 2020, 5:11pm UTC](https://forum.inductiveautomation.com/t/how-to-save-or-print-report-using-perspective-module/32048/2 "2020-02-07T17:11:56Z")

</div>

`executeAndDistribute` will save the report _on the gateway machine_.

If you want to download the report locally on whatever Perspective session you’re using, you need _two_ functions - `system.report.execute` and `system.perspective.download`. `system.report.execute` can return the binary data that constitutes your report, in whatever format you specify - then `system.perspective.download` allows you to send that data to the front-end and actually download a local file.

[https://docs.inductiveautomation.com/display/DOC80/system.perspective.download](https://docs.inductiveautomation.com/display/DOC80/system.perspective.download)

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [February 7, 2020, 6:54pm UTC](https://forum.inductiveautomation.com/t/how-to-save-or-print-report-using-perspective-module/32048/3 "2020-02-07T18:54:37Z")

</div>

@ptchanchal, In the upcoming 8.0.9 release, you'll also have a Report Viewer component that provides downloading/printing of reports in addition to the embedded report that you can interact with in a client session. It's available now in a nightly release if you'd like to play around with it.

> [@Report Viewer Component for Perspective](http://forum.inductiveautomation.com/t/report-viewer-component-for-perspective/31733):
>
> Report Viewer Component This component will be added in an upcoming nightly build. Embedding reports from the Reporting Module in views is now possible with the addition of this component. As long as the Reporting Module is installed, you’ll see the Report Viewer component at the bottom of the Perspective Components palette: [image] It’s super easy to get this component configured; just create a report and provide the path and name of that report in the source property of this component. Y…
