hi all,
in my application when i click on preview button then one pop up comes with print preview. there is print button in that pop up and when i click on that print button printing is done. all the things are working fine.
Now problem is that when i click on print button in print preview pop up the page behind pop up is redirecting to print preview page. i don't want to redirect it.
here is my code in jquery:
in this code when click on preview button this code runs:
var strVal='';
function PreviewReport(WithPrint)
{
var id;
id = document.getElementById('ctl00_ContentPlaceHolder1_lblMessage');
if (id != undefined)
{
strVal = id.innerHTML;
if(strVal == "")
{
return false;
}
else
{
if (WithPrint==1)
{
$("#PrintingDiv").load('ViewReportNew.aspx', { "strVal": strVal });
}
else
{
$("#PrintingDiv").load('ViewReportNew.aspx', { "strVal": strVal }).dialog({modal:true,width:780,height:550});
}
}
}
DPrint.style.display = 'block';
return false;
}
function PrintReport()
{
PreviewReport(0);
var prtContent = document.getElementById(strid);
var strOldOne = document.body.innerHTML;
var WinPrint = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=1,status=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
document.body.innerHTML = strOldOne;
return false;
}
on preview page this code runs:
<script language="javascript">
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=1,status=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
this.close();
}
</script>
any idea..