# Save Button not working

**URL:** <https://forum.inductiveautomation.com/t/save-button-not-working/10501>\
**Category:** Ignition\
**Created:** [September 22, 2015, 8:00pm UTC](https://forum.inductiveautomation.com/t/save-button-not-working/10501 "2015-09-22T20:00:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alewayhar](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@alewayhar](https://forum.inductiveautomation.com/u/alewayhar)\
**Post date:** [September 22, 2015, 8:00pm UTC](https://forum.inductiveautomation.com/t/save-button-not-working/10501/1 "2015-09-22T20:00:44Z")

</div>

I have the following code for a button that allows the user to save the report in the report viewer as a pdf

[code]from java.util import Date

table = event.source.parent.getComponent(‘Report Viewer’)

now = Date()

fileDate = system.db.dateFormat(now, “MM d, yyyy”)

filename = fileDate + “\_” + “Report” + “.pdf”

filePath = system.file.saveFile(filename, ‘pdf’, ‘report’)[/code]

The popup box comes up as if you were saving a document, but it does not actually save the document to the computer. What am I missing? It’s not throwing any errors, it’s just simply not saving the document to the computer.

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [September 22, 2015, 8:16pm UTC](https://forum.inductiveautomation.com/t/save-button-not-working/10501/2 "2015-09-22T20:16:53Z")

</div>

[system.file.saveFile](https://support.inductiveautomation.com/usermanuals/ignition/system_file_savefile.htm) does not save files. It only returns the path the user selected and provides a Save File dialog.

The documentation shows one way to actually write the file to disk (see link above).

Edit: I think you will only need to use [system.file.writeFile](https://support.inductiveautomation.com/usermanuals/ignition/system_file_writefile.htm)

---

<div class="post-metadata">

**Author:** ![alewayhar](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@alewayhar](https://forum.inductiveautomation.com/u/alewayhar)\
**Post date:** [September 22, 2015, 8:18pm UTC](https://forum.inductiveautomation.com/t/save-button-not-working/10501/3 "2015-09-22T20:18:17Z")

</div>

Thanks JGJohnson!

I was just about to post the same thing! When I had posted this post, inductive university was down, but now it’s up and the video about the report viewer was exactly what I needed and your link is even better and more direct! Thanks so much!

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [September 22, 2015, 8:19pm UTC](https://forum.inductiveautomation.com/t/save-button-not-working/10501/4 "2015-09-22T20:19:58Z")

</div>

You’re welcome. ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:")
