below is the code
function ExportToExcel() {
if ($("#dateRange").val() != "") {
var frm = $("#frmProjectReport").serialize();
var url = "/Reports/ProjectExcelReport?" + frm;
Download(url);
}
}
function Download(url) {
alert(url);
//var win = window.open(url, "DownloadWin", "resizable=0,status=0,toolbar=0,width=600px,height=300px");
var win = window.open(url, "DownloadWin", "width=600px,height=300px,scrollbars=yes ,menubar=no,location=no,left=0,top=0")
win.focus();
win.moveTo(100, 100);
}
its working in all browser except chrome.
I have used frame also as below code but it does't work in case of huge data..
function Download(url) {
try {
$("#fileIframe").html("");
var iframe = $('<iframe name="postframe" id="postframe" class="hidden" frameBorder="0" src="about:none" />');
$('#fileIframe').append(iframe);
$('#frmProjectReport').attr("action", url);
$('#frmProjectReport').attr("method", "post")
$('#frmProjectReport').attr("target", "postframe")
$('#frmProjectReport').submit();
//win = window.open(url, "DownloadWin", "width=600px,height=300px,scrollbars=yes ,menubar=no,location=no,left=0,top=0")
//win.focus();
//win.moveTo(100, 100);
}
catch (e) {
alert(e)
}
}