There seems to be no error in code but this does not download the excel file. Any suggestions would be appreciated.
Calling below JavaScript function on button click: