# Perspective table help exporting to excel

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803>\
**Category:** Ignition\
**Created:** [December 6, 2021, 6:21pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803 "2021-12-06T18:21:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [December 6, 2021, 6:21pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/1 "2021-12-06T18:21:46Z")

</div>

## How do I use button to export this data to excel?

I didn't understand the details of the what the help page says perhaps.  
I tried to mimic it.  
[https://docs.inductiveautomation.com/display/DOC81/Exporting+and+Importing+a+CSV](https://docs.inductiveautomation.com/display/DOC81/Exporting+and+Importing+a+CSV)  
[https://docs.inductiveautomation.com/display/DOC81/system.dataset.exportCSV](https://docs.inductiveautomation.com/display/DOC81/system.dataset.exportCSV)

It said event.source so I thought I better.  
Mine said .props.data so I thought mine should.

```python
component= event.source.parent.getChild("StopsData").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.file.saveFile("myExport.csv", "csv", "Comma Separated Values")
if filePath:
  system.file.writeFile(filePath, csv)	

```

This export is not working.

* * *

Then I also want to know where I would put the CSS code to change the color of some of data.  
I saw a few posts on this, but I think I am again missing some details of how to do the change.

## Where do I put code to change the color of a cell?

## Where do I put code to eliminate the bottom horizontal scroll bar from showing up?

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

---

<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:** [December 6, 2021, 6:34pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/2 "2021-12-06T18:34:14Z")

</div>

```auto
component= event.source.parent.getChild("StopsData").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.file.saveFile("myExport.csv", "csv", "Comma Separated Values")
if filePath:
  system.file.writeFile(filePath, csv)

```

system.file.saveFile is not available in a Perspective session.

Use system.perspective.download: [system.perspective.download - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.perspective.download)

So your new script would look like this:

```auto
component= event.source.parent.getChild("StopsData").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.perspective.download("myExport.csv",csv)

```

To change the color of a cell specifically you need to add a transform on the data so that on the column that you want to change the cell color on is a dict object with a value and a style: [Color perspective table cell depending on value in another column - #2 by ynejati](https://forum.inductiveautomation.com/t/color-perspective-table-cell-depending-on-value-in-another-column/21791/2)  
or  
[Cell Color in Perspective Table](https://forum.inductiveautomation.com/t/cell-color-in-perspective-table/50966)

Doing this will probably impact your first question though.

What I do for almost 100% of all tables is have a custom property on the view that is a dataset/json that holds the data that I want. Then on the table I do a transform. That way if I need to export the data out I have an un-spoiled copy of the data that I can do something with.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 6, 2021, 6:55pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/3 "2021-12-06T18:55:50Z")

</div>

@zacharyw.larson just for future, the manual states the scope for each function.

Example, [system.file.saveFile - Ignition User Manual 8.0 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC80/system.file.saveFile),  
shows vision client only.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [December 6, 2021, 6:58pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/4 "2021-12-06T18:58:47Z")

</div>

```auto
component= self.parent.getChild("StopsData").getChild("Table").props.data
csv = system.dataset.toCSV(component)
system.perspective.download("myExport.csv",csv)

```

Downloads the file to the downloads folder.

```auto
today = system.date.now()
fileSuffix=system.date.format(today, "yyyyMMddHHmm")
component= self.parent.getChild("StopsData").getChild("Table").props.data
csv = system.dataset.toCSV(component)
system.perspective.download("Stops"+fileSuffix+".csv",csv)

```

I got fancy and set the date of the save into the file name accurate to the minute.  
I might later append the dropdown of which machines to the file prefix of the file’s name.  
Thanks again for the help.

How do I have this open a dialogue box to set the location to save the file?  
Or is downloading to the downloads more acceptable?

---

<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:** [December 6, 2021, 7:02pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/5 "2021-12-06T19:02:55Z")

</div>

Yep it will download the file to the default directory for the browser downloads. I don’t know of a way to popup a dialog box to allow the end user to select the save to location.

---

<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:** [December 6, 2021, 7:24pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/6 "2021-12-06T19:24:00Z")

</div>

You have to tell your your browser to ask every time. Perspective has no control once the download is handed off to the browser.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [October 27, 2022, 6:01pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/7 "2022-10-27T18:01:54Z")

</div>

How do I get it to ask for file location?

---

<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:** [October 27, 2022, 6:03pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/8 "2022-10-27T18:03:55Z")

</div>

You tell your browser to ask. Most browsers default to your Downloads folder. You have to tell the browser not to do that. Perspective can't do that for your users.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [October 27, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/9 "2022-10-27T18:05:22Z")

</div>

Not to be ignorant but vision was my bread and butter up to 4 months ago and I had it working there but in Perspective I have no idea where to disable this so it asks.

---

<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:** [October 27, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/10 "2022-10-27T18:09:09Z")

</div>

In your browser's "Options" or "Preferences" or "Settings" menu. Just like you do for downloads from any other website.

It will help you adjust to Perspective if you treat your client's machine as entirely off-limits. Your users just have a view into your operation through their browser.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [October 27, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/11 "2022-10-27T18:12:46Z")

</div>

I thought you were talking about something in Perspective. Thanks Phil

---

<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:** [October 27, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/12 "2022-10-27T18:14:39Z")

</div>

> [@CTrenkamp](#):
>
> something in Perspective

> [@pturmel](#):
>
> Perspective can't do that for your users.

Off limits, see?

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [October 27, 2022, 6:34pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/13 "2022-10-27T18:34:57Z")

</div>

I did find however that script may be used to alter the download folder for Chrome.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [October 27, 2022, 6:42pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/14 "2022-10-27T18:42:00Z")

</div>

Are you going to share how?  
Can we request a folder creation?

Is it related to this:

> [Sign in - Google Accounts](https://sites.google.com/a/chromium.org/chromedriver/capabilities)

and

"If anyone is still having trouble and the above solutions didn't work, I found adding a following slash ('') to my download path.

Mine looked like this:"

```auto
 if browser == 'chrome':
        options = webdriver.ChromeOptions()
        options.add_argument("--start-maximized")
        prefs = {"profile.default_content_settings.popups": 0,
                 "download.default_directory": r"C:\Users\user_dir\Desktop\\", # IMPORTANT - ENDING SLASH V IMPORTANT
                 "directory_upgrade": True}
        options.add_experimental_option("prefs", prefs)
        return webdriver.Chrome(executable_path=Base.chromedriver_dir, chrome_options=options)

```

from

> [Selenium Webdriver in Python - files download directory change in Chrome preferences - Stack Overflow](https://stackoverflow.com/questions/18026391/selenium-webdriver-in-python-files-download-directory-change-in-chrome-prefere)

Or are those webdrivers not compatible with Ignition?

---

<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:** [October 27, 2022, 6:52pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/15 "2022-10-27T18:52:50Z")

</div>

> [@CTrenkamp](#):
>
> alter the download folder for Chrome

Not for stock Chrome. The user needs to install something that permits this kind of security bypass.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [October 28, 2022, 11:54pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/16 "2022-10-28T23:54:52Z")

</div>

component= self.parent.getChild("StopsData").getChild("Table").props.data  
csv = system.dataset.toCSV(component)  
system.perspective.download("myExport.csv",csv)

Thanks 'bschroeder' this worked just fine for me minus the change to table data location.

---

<div class="post-metadata">

**Author:** ![patrixmith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrixmith/32/75926_2.png) [@patrixmith](https://forum.inductiveautomation.com/u/patrixmith)\
**Post date:** [October 3, 2023, 9:57pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/17 "2023-10-03T21:57:52Z")

</div>

Howdy. Was using this thread for a few things, but just FYI, if you use Perspective Workstation instead of an OS browser, it will automatically prompt the user to choose a save location. That method helps so users don't need to modify their browser settings to make it ask for a file location.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [February 9, 2024, 5:43pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/18 "2024-02-09T17:43:55Z")

</div>

Unfortunately there are permission issues and whether or not the user has admin rights to allow Ignition to access folder on that persons computer. Using what I did takes all that out of the picture, but you may be doing something else.

---

<div class="post-metadata">

**Author:** ![Roger\_Weidling1](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Roger\_Weidling1](https://forum.inductiveautomation.com/u/Roger_Weidling1)\
**Post date:** [May 23, 2025, 8:32am UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/19 "2025-05-23T08:32:56Z")

</div>

Not really a programmer, so I am sure I am missing something simple. I tried using this script to have a button export to CSV but getting an error. I have a View with HeaderContainer with my Button in it and a BodyContainer with the "Table" in it. My error is "object has no attribute source" What should it say to direct it to the BodyContainer for the Table?

```
component= event.source.parent.getChild("BodyContainer").getChild("Table")
csv = system.dataset.toCSV(component.props.data)
system.perspective.download("myExport.csv",csv)

```

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [May 23, 2025, 2:00pm UTC](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803/20 "2025-05-23T14:00:32Z")

</div>

Navigate from `self`, not `event`:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/7/47ba6fe475aa4e2efca911b4a4d63553bb5467e6.png)

[Next page](https://forum.inductiveautomation.com/t/perspective-table-help-exporting-to-excel/53803.md?page=2)
