-2

I have using the window.print() function to print the page result.

In aspx Page :

<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>

In user Control Page :

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

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

I have checked the print option in(IE11, IE10, Firefox, Chrome) browsers, working fine in our end.

But some other system throws the following error:

Error

Anyone can meet out this issue..?

bgs
  • 3,061
  • 7
  • 40
  • 58
  • Refer this article http://support.microsoft.com/kb/308260. It helps to solve your issue. – Earth Nov 04 '14 at 10:03
  • http://stackoverflow.com/questions/2555697/window-print-not-working-in-ie – vatsal Nov 04 '14 at 10:04
  • -1 for not posting enough code to repro the problem and opening a bounty without responding to the 2 links people have already provided. how the heck are you expecting anyone to help you this way? – Robert Levy Nov 10 '14 at 13:54
  • @RobertLevy, please find edited post.. – bgs Nov 10 '14 at 13:56
  • is that sufficient for us to reproduce the problem? perhaps the problem is in the 500 lines of code you chose to leave out rather than the 1 you chose to share. perhaps the links other folks gave you already are sufficient to solve the problem. – Robert Levy Nov 10 '14 at 14:04
  • @RobertLevy, This information can enough to reproduce the problem.. If you can, answer the post. Otherwise leave it.. So many genuine skill persons are there in SE.. Your comments are looks like haughtiness.. More than 2000 skilled persons are there in SE.. you are a not god for se or .net. Please go away from this post.. – bgs Nov 11 '14 at 05:15
  • i really just dont understand why you haven't responded to the comments left by people that *are* trying to help you. if those links don't help you, tell us why not so then you can get more useful answers – Robert Levy Nov 11 '14 at 14:50

1 Answers1

1

This error is well documented on Microsoft see this KB2652062, it append on Internet Explorer when the printer driver (on client machine) is not updated, corrupted or not configured.

Also the error occurs when the printer is shared on network and the client cannot reach it or the printer append from a Terminal Server.

You can update/configure the driver on the client or maybe or you can try to wrap the window.print() on try/catch:

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

Anyway since cannot repros the error I cannot know if working.

Max
  • 6,821
  • 3
  • 43
  • 59