none
Trying to Print in IE10

    Question

  • I have an aspx page developed in VS2010.

    I have created a template and display data on the page.

    The Page has a Print button on it. when "clicked" the code executed is:

    <script type="text/javascript">

    functionprintpage()

                {

                    Printer.startPrint();

                }

    </script>

    This code works when browsed with Chrome or Firefox shows the print dialog and prints to the selected printer. (Just the behavior I want.) When I browse with IE10 I get the print dialog and when I click to print I get an error :

    HandleError("Internal Error occured during printPage(). This could because of a GDI or D2D failure.",document.URL,"CPrintDoc_Print"

    );

    }

    Printer.stopDoc();

    }

    And the Document does not print. I am admittedly a newbie for this type of development and would sincerely appreciate any help anyone can give me.

    ED


           

       



    With women, the TRUTH will not only NOT set you free, it will cause you a great deal of trouble.

    Thursday, June 27, 2013 10:04 PM

Answers

  • J Chase

    I got your reply about the other thread with the dirvers issue.

    I am printing to a networked printer, with, I think, the correct drivers.

    Also following the thread to the end, it appears that the issue was not resolved and also another forum member chimed in and was having the same issue with an HP printer.

    Is your printer attached directly to your computer when printing form IE10?

    I added a command 

    return(false);

    after the window(print);

    This caused it to print intermittently. Any thoughts?

    ALSO, I sincerely appreciate your taking the time to try to help me.

    CLW

    return(false);


    With women, the TRUTH will not only NOT set you free, it will cause you a great deal of trouble.

    Monday, July 01, 2013 2:31 PM

All replies

  • I'm not sure what the Printer class is in your code but if you use window.print() instead it will work in IE10 (as well as the other browsers).
    Friday, June 28, 2013 12:40 AM
  • I am sorry I failed to mention that window.print() exhibits the same behavior and was tried first.

    this is All of the code for the page:

     Printer.startprint(); originally WAS window().print;

    I appreciate your reply and if you and tell me what I am missing or doing wrong I would appreciate it.

    Ed

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <style type="text/css">
            @media print, screen
            {   
                body{
                    padding:0;
                    margin:0;
                    }
                div.masterContent{
                    background-color:#ccc;
                    width:768px;
                    height:1024px;
                    }
                p{
                    font-family:georgia, times, serif; 
                    font-size:x-large;
                    color:Green;
                    }
                .printButton{
                    background-color:#666;
                    padding:5px;
                    padding-
                    border:1px solid black;
                    color:White;
                    text-decoration:none;
                    }
                div.orderHeaderLogo{
                    
                    
                    
                    }
                div.orderHeaderText{
                    
                    
                    
                    color:#000;
                    font-family:Arial;
                    font-size:large;
                    font-weight:bolder;
                    }
                div.break1
                {
                    margin:auto;
                    
                    clear:both;
                    
                    height:1px;
                    background-color:#666;
                    width:100%;
                    }
                div.Bill2Address
                {
                    
                    
                    
                    padding:12px;
                    color:#000;
                    font-family:Arial;
                    font-size:12px;
                    font-weight:bold;
                }
                div.Ship2Address
                {
                    
                    
                    
                    padding:12px;
                    color:#000;
                    font-family:Arial;
                    font-size:12px;
                    font-weight:bold;
                }
                div.break2
                {
                    margin:auto;
                    
                    clear:both;
                    
                    height:1px;
                    width:100%;
                    }
    
                div.lineItem
                {
                    
                    
                    
                    padding:3px;
                    color:#000;
                    font-family:Arial;
                    font-size:12px;
                    font-weight:bold;
                }
                .boxHeader
                {
                    border:1px solid black;
                    text-align:center;
                    }
                div.footerPrinter
                {
                    
                                    
                    } 
                
            }
            
            
             @media print
             {
                div.footerPrinter
                {
                
                display:none;    
                    } 
                 
             }
            
            
        </style>
        <script type="text/javascript">
            <!--
            function printpage() 
                {
                    Printer.startPrint();
                }
        </script>
    </head>
    <body>
    <div class="masterContent">
    
        <div class="orderHeaderLogo">
            <img src="Images/CrescentLogo2007.bmp" alt="Read/Write Property"/> 
        </div>
    
        <div class="orderHeaderText">
            Sales Order
        </div>
        <div class="break1">
            
        </div> 
    
        <div class = "Bill2Address">
            Regis Radiator Service, Inc.
            <br />
            P.O Box 307
            <br />
            Marrero, LA 70073
            <br />
        </div>
        <div class = "Ship2Address">
            Regis Radiator Service, Inc.
            <br />
            1101 Ave A
            <br />
            Marrero, LA 70073
            <br />
        </div>
        <div class="break2"></div>
        <div class ="lineItem">
            <table width="100%">
                <tr>
                    <td class="boxHeader">product code</td>
                    <td>description</td>
                    <td>quantity ordered</td>
                    <td>price</td>
                    <td>amount</td>
                </tr>
        <%
        dim lineCount : lineCount = 3
        for i = 0 to lineCount
        %>
            
               <tr>
                   <td>product code</td>
                   <td>description</td>
                   <td>quantity ordered</td>
                   <td>price</td>
                   <td>amount</td>
               </tr>
    <%
    next  
    %>
        </table>
      </div>
      <div class="footerPrinter">
      <a href="#" onclick="window.print()" class="printButton">print</a>
        </div>
    
    </div>
    </body>
    </html>

    I am sorry I failed to mention that window.print() exhibits the same behavior and was tried first.

    this is All of the code for the page:

     

     

     

     


    With women, the TRUTH will not only NOT set you free, it will cause you a great deal of trouble.

    Friday, June 28, 2013 12:35 PM
  • I tried your markup in IE10 and Chrome and didn't have any problems. I found this thread which suggests the error you are getting is a driver issue , and to try out printing to an XPS Document Writer to confirm whether it is or not.
    Saturday, June 29, 2013 1:22 AM
  • J Chase

    I got your reply about the other thread with the dirvers issue.

    I am printing to a networked printer, with, I think, the correct drivers.

    Also following the thread to the end, it appears that the issue was not resolved and also another forum member chimed in and was having the same issue with an HP printer.

    Is your printer attached directly to your computer when printing form IE10?

    I added a command 

    return(false);

    after the window(print);

    This caused it to print intermittently. Any thoughts?

    ALSO, I sincerely appreciate your taking the time to try to help me.

    CLW

    return(false);


    With women, the TRUTH will not only NOT set you free, it will cause you a great deal of trouble.

    Monday, July 01, 2013 2:31 PM
  • Hello All.

    Turns out the problem was with my local IIS on my development environment. Just for the hell of it I uploaded code to my website and what do you know? IE10 prints just fine. There's a few hours of my life I'll never get back....

    Sorry for the grief, thanks for the help.

    CLW


    With women, the TRUTH will not only NOT set you free, it will cause you a great deal of trouble.

    Monday, July 01, 2013 3:37 PM