# Exporting data from a Easy Chart

**URL:** <https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326>\
**Category:** Ignition\
**Created:** [April 11, 2022, 8:45pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326 "2022-04-11T20:45:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [April 11, 2022, 8:45pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/1 "2022-04-11T20:45:47Z")

</div>

When exporting data from a Easy Chart, when I open the excel file it puts the data in different sheets. The labels for the sheets says Dataset 1, Dataset 2 , Dataset 3, etc. Is there a way to give it a different name so someone can know what equipment the Dataset belongs to

---

<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:** [April 11, 2022, 10:00pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/2 "2022-04-11T22:00:12Z")

</div>

Not directly from the chart, but you can ask the chart to `exportDatasets` and pair that return value with `system.dataset.toExcel`:  
[https://docs.inductiveautomation.com/display/DOC81/system.dataset.toExcel](https://docs.inductiveautomation.com/display/DOC81/system.dataset.toExcel)

Then use `system.file.saveFile` to prompt the user for where to save the file.  
[https://docs.inductiveautomation.com/display/DOC81/system.file.saveFile](https://docs.inductiveautomation.com/display/DOC81/system.file.saveFile)

And then `system.file.writeFile` to actually save it to disk:  
[https://docs.inductiveautomation.com/display/DOC81/system.file.writeFile](https://docs.inductiveautomation.com/display/DOC81/system.file.writeFile)

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 11, 2022, 10:08pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/3 "2022-04-11T22:08:39Z")

</div>

Do you mean individual excel documents, because i think `system.dataset.toExcel` is just going to name your sheets Dataset 1, Dataset 2 etc.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [April 11, 2022, 10:31pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/4 "2022-04-11T22:31:20Z")

</div>

It needs to be the same document.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 11, 2022, 10:33pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/5 "2022-04-11T22:33:44Z")

</div>

I should have replied to @paul-griffith. I did a little testing and it doesn’t look like you have any control over the sheet names.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [April 11, 2022, 10:37pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/6 "2022-04-11T22:37:53Z")

</div>

Is there a way to get around it using a script on a button?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 11, 2022, 10:40pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/7 "2022-04-11T22:40:38Z")

</div>

I tried that but still got the same thing. Alternatively you could do something like include the machine name in the tag path.

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

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [April 11, 2022, 10:42pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/8 "2022-04-11T22:42:11Z")

</div>

I even tried grouping the data into equipment but you get the same results

---

<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 11, 2022, 11:41pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/9 "2022-04-11T23:41:35Z")

</div>

Consider using Apache POI libraries' API for Microsoft file formats. Start here:

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/13):
>
> Got my paperwork done early, so here's a sample to read from an Excel file EDIT: Reworked a bit to work with both .xls and .xlsx files EDIT: Modified to properly cast data types EDIT: Added handler for formula cell types EDIT: Added parameters to optionally specify sheet, row, and column numbers Reading back a file created from my other example: def excelToDataSet(fileName, hasHeaders = False, sheetNum = 0, firstRow = None, lastRow = None, firstCol = None, lastCol = None): import org.apac…

Examine the javadocs to work out writing instead of reading.

Total control.

(The java api is included in Ignition v8+. You can add a 3rd party module, like Kymera's office documents module, to get access in v7.9.)

---

<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:** [April 11, 2022, 11:51pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/10 "2022-04-11T23:51:30Z")

</div>

> [@josborn](#):
>
> I should have replied to @paul-griffith. I did a little testing and it doesn’t look like you have any control over the sheet names.

There should be a trailing argument `sheetNames` for `toExcel`:

> List sheetNames - Expects a list of strings, where each string is a name for one of the datasets. When used, there must be an equal number of string names in `sheetName` as there are datasets in the `dataset` parameter. Names provided in this parameter may be sanitized into acceptable Excel sheet names. [optional]

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 11, 2022, 11:54pm UTC](https://forum.inductiveautomation.com/t/exporting-data-from-a-easy-chart/58326/11 "2022-04-11T23:54:52Z")

</div>

How did i miss that?! As usual you are absolutely correct, thank you!
