2014-11-04 233 views
-2

我已經使用window.print()函數打印頁面結果。window.print()拋出錯誤在IE瀏覽器行1791在preview.js

在ASPX頁面:

<table cellpadding="4" cellspacing="1" border="0" align="center" class="noprint" width="98%"> 
     <tr><td class="title" height="22">XXXXXX</td></tr> 
    </table> 

    <FHR:ErrMessage ID="EM" runat="server" visible="false" /> 

    <asp:Panel ID="PanelView" runat="server" Visible="false" > 
     <ucl:uclView ID="XXXViewScreen" runat="server" ></ucl:uclView> 
    </asp:Panel> 

在用戶控制Page:

/ More than 500 lines code/
In last line of the page : 

<input type="button" value="Print" onclick="window.print();" class="winbutton"/> 

我在(IE11,IE10,火狐,Chrome)瀏覽器,檢查打印選項工作在我們的最終罰款。

但一些其他系統引發以下錯誤:

Error

任何人都可以滿足了這個問題..?

+0

請參閱這篇文章http://support.microsoft.com/kb/308260。它有助於解決您的問題。 – 2014-11-04 10:03:11

+0

http://stackoverflow.com/questions/2555697/window-print-not-working-in-ie – vatsal 2014-11-04 10:04:22

+0

告訴我們你的代碼 – 2014-11-10 13:52:19

回答

1

這個錯誤在Microsoft看到這個KB2652062很好地記錄,當打印機驅動程序(在客戶端計算機上)未更新,損壞或未配置時,它附加在Internet Explorer上。

此外,當打印機在網絡上共享並且客戶端無法連接到打印機或打印機從終端服務器追加時出現錯誤。

您可以更新/配置客戶端或可能對駕駛員或者你可以嘗試包裹window.print()上的try/catch:

try { 
    window.print(); 
} 
catch(err) { 
    console.log("cannot print");  
} 

反正既然不能repros如果工作,我不知道該錯誤。

+0

Thanx Max,問題是網絡錯誤,同樣已解決.. – bgs 2014-11-17 05:17:51

相關問題