How to trigger export on custom button click?

I have a script report. Just like any other report I can export its data (rows/columns) in excel or csv format.
I have a custom button in this script report called “Non Redundant Export”. How can I trigger the original export button’s functionality when I click on my custom button.

Any help is appreciated.

Use Reference of Frappe Team Code to achieve your Customisation.
Find this function def export_query(): and look the code

@pra17shant Thanks for your help.

Any Time