# Export dataset to XLS filetype from Time Series Chart

**URL:** <https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539>\
**Category:** Ignition\
**Created:** [August 4, 2021, 9:22am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539 "2021-08-04T09:22:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [August 4, 2021, 9:22am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/1 "2021-08-04T09:22:12Z")

</div>

Hi guys, have a good days.

Currently I have a configurable Time Series Chart which the user is able to choose the start date and end date. After the user generate the chart I would like export the dataset in xls format. May I know what is the best way to do it because I had tried in many ways but it dint work.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/86b4a289ab9d36ec0a3fd7cd2663a4abfdb86cf6.png)

Image above show the time series chart and the dataset in Ignition Designer. May I know how can I read the dataset and export the xls file format or I should read the timeserieschart data then only export in xls format.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 4, 2021, 11:50am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/2 "2021-08-04T11:50:54Z")

</div>

This thread may be of use.

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/7):
>
> The [Apache POI](https://poi.apache.org/apidocs/4.1/index.html) libraries are included with Ignition. At the time I was only needing to read files, so xlrd was all that was necessary. I'm just starting to dig into POI, myself, but here's a start: EDIT 2021-08-23: Updated to allow JsonDataSets. Changed to allow for a ByteArray output instead of writing to a file. EDIT 2023-01-20: Added option for date formats. Default is 'yyyy-MM-dd hh:mm:ss'. EDIT 2023-05-12: Added options for first row and column, if needed to offset from A1 def datasetT…

---

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [August 5, 2021, 12:37am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/3 "2021-08-05T00:37:20Z")

</div>

@JordanCClark Hi Bro, thanks for your link but this is not the one I want. What I want is export the data in the dataset to excel format by clicking a button in the perspective. So I think what I need to use is system.dataset.toExcel but I had tried this code but it dint work. May I know that is there any example.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 5, 2021, 8:57am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/4 "2021-08-05T08:57:37Z")

</div>

Trust me. That thread has both.

---

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [August 5, 2021, 8:58am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/5 "2021-08-05T08:58:34Z")

</div>

Ok Thanks a lot @JordanCClark. I’ll give a try.

---

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [August 11, 2021, 6:59am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/6 "2021-08-11T06:59:03Z")

</div>

Hi, @JordanCClark I had tried by following the thread you provided but I still facing some problems which I could not get the dataset from the Time Series Chart as the image shown below.

 ![Dataset](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c80e23450f10458f583bfd9b9c1fe82fdf26a6f.png)

The thread that you provided is hard code the dataset inside the script. In my case, I would like to get the dataset from Time Series Chart like the image above. May I know how can I do that ?  
Image below show the hard code of the data set in the script.

 ![code](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1b7d9750587ca56f1baf89a03a9878d9a21956a0.png)

[https://forum.inductiveautomation.com/t/exportdatasets-for-the-easy-chart-component/9618](https://forum.inductiveautomation.com/t/exportdatasets-for-the-easy-chart-component/9618)

Link above is the exportDatasets() for the easy chart component. May I know did you try these before because I could not found this code in the Ignition documentation.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 18, 2021, 12:38pm UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/7 "2021-08-18T12:38:12Z")

</div>

Sorry, been on vacation…

You’re talking about two very different components with very different properties.

Try pointing ds in the script to the data property in your series.

---

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [August 19, 2021, 4:54am UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/8 "2021-08-19T04:54:36Z")

</div>

Hi @JordanCClark, it is good to hear from you again.

Yaa, I had tried to point the dataset in the script but it cant work.

Do you have any example or you have any idea to write the script that to pointing the dataset to the data property in the series.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 23, 2021, 12:33pm UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/9 "2021-08-23T12:33:49Z")

</div>

Finally got some time to dig into this a bit further for you.  
I updated the linked script to allow for JsonDataSets, and to allow the output to be a byte array.

I put the function into a project script (I used _util_), than called it from a button:

```python
	dataIn = self.getSibling("TimeSeriesChart").props.series[0].data
	workbook = util.datasetToExcel(dataIn)		
	system.perspective.download('data.xlsx', workbook)

```

---

<div class="post-metadata">

**Author:** ![Meena\_M](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Meena\_M](https://forum.inductiveautomation.com/u/Meena_M)\
**Post date:** [December 15, 2022, 2:04pm UTC](https://forum.inductiveautomation.com/t/export-dataset-to-xls-filetype-from-time-series-chart/49539/10 "2022-12-15T14:04:12Z")

</div>

The script mentioned above has been implemented, now i can able to download multiple dataset in single excel file at different sheets.  
Now i need to change the sheet names using script , can you please help on this  
(Dataset1,Dataset2,Dataset3.......) to different names , refer to the screenshot.

 ![Screenshot (332)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/82426cdcf674c4196b77e209594cd84328ee912f.png)
