Hi DevaPriya,
you can only use the default “export to excel” function on datagrids.
If you want to be able to use it somewere else, have a look at the excel export module.
Documentation: https://docs.mendix.com/howto/integration/using-the-excel-exporter/
You can change the data source from data to XPath and you can have the export option.