1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

window_print() not working from browser

Discussion in 'SQL PL/SQL' started by jesthr@gmail.com, Jul 31, 2014.

  1. jesthr@gmail.com

    jesthr@gmail.com Active Member

    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    80
    I have Oracle v11 and I have a single PL/SQL scripts, as the internet application
    I'm using window.print() for printing

    I would like to print directly from browser without print popup window
    I have own procedures for testing, but no success, it not work

    The following is a test case!

    Can only help me to solve this problems

    Regards!

    Hine
    ------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE TEST_PRINT
    AS
    begin
    htp.prn('<!DOCTYPE html>
    <html>
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <script type="text/javascript">
    var PrintCommandObject = null;
    function printPage(){
    if (PrintCommandObject)
    {
    try{
    PrintCommandObject.ExecWB(6, 2);
    PrintCommandObject.outerHTML = "";
    }
    catch(e){
    alert(e);
    window.print();
    }
    }
    else{ window.print(); }
    }
    </script>
    <title>PrintPage</title>
    </head>
    <body>
    <object id="PrintCommandObject" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" width="0" height="0"></object>
    <button type="button" onclick="printPage()">Print</button>
    </body>
    </html>');
    end;