Perspective Table excel report

I wonder is it possible to get an excel report from Perspective table info? someone just click on button and export all info to excel file?

Slap a button on the view, grab the dataset from the table and run it through system.dataset.toExcel: system.dataset.toExcel - Ignition User Manual 8.1 - Ignition Documentation and system.perspective.download system.perspective.download - Ignition User Manual 8.1 - Ignition Documentation

Stripped example from a working application:

tableDS= self.parent.getChild("Table").props.data
excelBytes= system.dataset.toExcel(True,tableDS)
fileName = 'TableExport{}.xlsx'.format(system.date.format(system.date.now(),'yyyMMd_kms'))
system.perspective.download(fileName,excelBytes,'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')	
5 Likes

Thank you. It works.

1 Like