Export to Excel

Hi All!
First of all, sorry for my English.

Here is questions about export Table to excel.
I using this script

fpmi.dataset.exportExcel(“MyReport”, 1, event.source.parent.parent.getComponent(‘RESULT’).getComponent(‘Table 1’).data)

After button click, open window which offer to me Save MyReport.xls
1 question - In line withfile name, I deleted .xls. If i try to save without .xls ( MyReport ), result is unopened File. Client must specify which programm must use for open file…
2. Can I hide .xls format in line, where we insert file name, that after saving will be excel file?
3 question .xls is old format of Excel. Can we save like .xlsx?
Thanks

  1. Your operating system uses the file’s extension for a clue about what program should open the file. When you delete the extension, the OS loses that clue and the user will need to specify the program.

  2. I’m guessing at what you mean here, but I think what you want is to have system.dataset.exportExcel() automatically append the .xls extension without the user seeing it. Currently there’s no way to do that (but you should suggest it at ideas.inductiveautomation.com). You would need to do this yourself through scripting in multiple steps – getting the file path and name from the user, adding the .xls extension if needed, getting the dataset as excel format (system.dataset.dataSetToExcel()) and then saving the file (system.file.writeFile())

  3. Not with stock Ignition currently, but there are at least two third party modules that will do this. It’s possible they may also help with #2.