Просто передайте этот URl .. У него тот же сценарий, который вы хотите, например
<button>Export</button>
и в вашем js
$("button").click(function(){
$("#table2excel").table2excel({
// exclude CSS class
exclude:".noExl",
name:"Worksheet Name",
filename:"SomeFile",//do not include extension
fileext:".xls" // file extension
});
});
и в вашем .cshtm / html
<tr class="noExl">
<th>#</th>
<th>Column heading</th>
<th>Column heading</th>
<th>Column heading</th>
https://www.jqueryscript.net/table/Export-Html-Table-To-Excel-Spreadsheet-using-jQuery-table2excel.html