Browse Source

报表打印bug

zhuth 7 years ago
parent
commit
54f52632fe
1 changed files with 4 additions and 4 deletions
  1. 4 4
      frontend/saas-web/app/view/core/report/ReportPanelController.js

+ 4 - 4
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -52,11 +52,11 @@ Ext.define('saas.view.core.report.ReportPanelController', {
             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();
         }
+        var 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);