Export to excel different columns as per toggle selection

Hi Team
I have a request where I need to export different set of columns as per the selection.
For e.g. I have Col 1 , Col2, Col3, Col4, Col5 in the data and I have a custom “Export to excel” Button .
Now I want to create a toggle button when the user selects Toggle ON and click “Export to excel” button then Col 1 , Col2, Col3, Col4 gets exported,
AND when I select Toggle OFF and click “Export to excel” button then Col 1 , Col2, Col3, Col5, should be exported.

Is it possible ?
Note : My “Export to Excel” is a custom button and not the Dundas provided.

Hi,

On toggle button click, can you not hide Col5 (table1.control.columns[column index].isVisible = false;) in the table visualization and then export? That should do the job ideally.

1 Like