# Label Datasets Exported to Excel

**URL:** <https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 13, 2018, 8:01pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351 "2018-03-13T20:01:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaynes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmaynes/32/6852_2.png) [@cmaynes](https://forum.inductiveautomation.com/u/cmaynes)\
**Post date:** [March 13, 2018, 8:01pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/1 "2018-03-13T20:01:49Z")

</div>

How can I label the datasets I export to excel?

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [March 14, 2018, 6:11pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/2 "2018-03-14T18:11:43Z")

</div>

Can you be more specific? If you just want the headers in excel, there is the showHeaders boolean parameter for the dataSetToExcel API function.

[https://docs.inductiveautomation.com/display/DOC79/system.dataset.dataSetToExcel](https://docs.inductiveautomation.com/display/DOC79/system.dataset.dataSetToExcel)

---

<div class="post-metadata">

**Author:** ![cmaynes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmaynes/32/6852_2.png) [@cmaynes](https://forum.inductiveautomation.com/u/cmaynes)\
**Post date:** [March 14, 2018, 9:50pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/3 "2018-03-14T21:50:46Z")

</div>

When you export a few datasets to excel, the tab names are generic ( Dataset1, Dataset2,… ).

This is currently confusing some of our users, especially when we export 9 or 10 datasets into one spreadsheet.

Can I label these tabs? If Ignition doesn’t have this functionality, could you suggest a python or java library that can handle this - keeping in mind that the changes need to be completed before the user saves the file to their computer.

---

<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:** [March 14, 2018, 10:40pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/4 "2018-03-14T22:40:07Z")

</div>

How are you currently doing the export? Maybe a starting point would be helpful.

---

<div class="post-metadata">

**Author:** ![cmaynes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmaynes/32/6852_2.png) [@cmaynes](https://forum.inductiveautomation.com/u/cmaynes)\
**Post date:** [March 14, 2018, 10:47pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/5 "2018-03-14T22:47:22Z")

</div>

```
DataSetsList = [LIST OF DATASETS]
Alias = Job.getValueAt( 0, 'Alias' )
SuggestedFileName = Alias + ' Data' + '.xls'
FilePath = DestinationPath + '\\' + SuggestedFileName
ExcelFile = system.dataset.dataSetToExcel( True, DataSetsList )
system.file.writeFile( FilePath, ExcelFile )
```

---

<div class="post-metadata">

**Author:** ![phillip.bow](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phillip.bow](https://forum.inductiveautomation.com/u/phillip.bow)\
**Post date:** [March 14, 2018, 10:50pm UTC](https://forum.inductiveautomation.com/t/label-datasets-exported-to-excel/17351/6 "2018-03-14T22:50:03Z")

</div>

This is pretty hokey, but the dataSetToExcel function technically just returns an XML string that makes up the document.

So you could do a string replace for:

```auto
#dataset1
ExcelFile.replace("ss:Name=\"Dataset 1\"", "ss:Name=\"SpectacularDataSet\"")

#dataset2
ExcelFile.replace("ss:Name=\"Dataset 2\"", "ss:Name=\"TerrificDataSet\"")

system.file.writeFile( FilePath, ExcelFile )

```
