|
|
@@ -45,9 +45,21 @@ Ext.define('saas.view.core.report.ReportPanelController', {
|
|
|
});
|
|
|
},
|
|
|
printHtml: function(html){
|
|
|
- var d = window.open("", "print");
|
|
|
- d.document.write(html);
|
|
|
- d.document.close();
|
|
|
- d.print();
|
|
|
+ var iframe=document.getElementById("saas-print-iframe");
|
|
|
+ if(!iframe){
|
|
|
+ iframe = document.createElement('IFRAME');
|
|
|
+ var doc = null;
|
|
|
+ iframe.setAttribute("id", "saas-print-iframe");
|
|
|
+ iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
|
|
|
+ document.body.appendChild(iframe);
|
|
|
+ doc = iframe.contentWindow.document;
|
|
|
+ doc.write(html);
|
|
|
+ doc.close();
|
|
|
+ iframe.contentWindow.focus();
|
|
|
+ }
|
|
|
+ iframe.contentWindow.print();
|
|
|
+ if (navigator.userAgent.indexOf("MSIE") > 0){
|
|
|
+ document.body.removeChild(iframe);
|
|
|
+ }
|
|
|
},
|
|
|
});
|