function generateXLS(){
    var data = {};
    $.each($("#SearchTable").find('input, select'), function (key,input){
        data[$(input).prop('name')] = $(input).val();
    });
    $.ajax({
        type: "POST",
        url: 'index.php?module=EcmReports&action=ReportSalesByGroup&to_pdf=1&to_xls=1',
        dataType: "html",
        data: data,
        async: false,
        success: function(response){
            console.log(response);
            var new_window = window.open(response);
        }
    });
}
function generatePDF(){
    var data = {};
    $.each($("#SearchTable").find('input, select'), function (key,input){
        data[$(input).prop('name')] = $(input).val();
    });
   $.ajax({
        type: "POST",
        url: 'index.php?module=EcmReports&action=ReportSalesByGroup&to_pdf=1&to_pdf_gen=1',
        dataType: "html",
        data: data,
        async: false,
        success: function(response){
            var new_window = window.open(response);
        }
   });
}