In this code I want to specify the filename when downloading the excel format.
if(comp_id != "Select Company")
{
  $.ajax({
    url: 'includes/export.php',
    data: {
      action: 'compreport', 
      'comp':comp_id,   
    },
    type: 'post',
    success: function (output) {
      $("#ereportview").html(output);
      window.open('data:application/vnd.ms-excel,' + encodeURIComponent( $('div[id$=ereportview]').html()));
      e.preventDefault();
    },
    async: false
  });  
}
 
     
     
    