6 Replies Latest reply on Sep 12, 2017 7:40 AM by Billy~Verreynne

    Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.

    3537569

      So we have a Oracle DB on a Linux server (Oracle 12c).  We use database packages to build html code that users can use to view various information on the webpages.  One of our webpages uses an old vbscript function to download a table to excel.  The export works except in Windows 10 which we are now upgrading to for all our user workstations.  I have attempted several solutions using javascript in the html code, but none of my attempts have worked.  I have also tried using jquery pluigin tableExport, but it does not work either.  Does anyone have an example of a Oracle DB package that creates html/javascript to perform a download of an html table to Excel.  We are required to use Internet Explorer as our browser.  Thanks in advance for any help.

       

      Mark

        • 2. Re: Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.
          John Thorton

          22997c30-b0a1-473e-a81c-2b0179782ee9 wrote:

           

          So we have a Oracle DB on a Linux server (Oracle 12c). We use database packages to build html code that users can use to view various information on the webpages. One of our webpages uses an old vbscript function to download a table to excel. The export works except in Windows 10 which we are now upgrading to for all our user workstations. I have attempted several solutions using javascript in the html code, but none of my attempts have worked. I have also tried using jquery pluigin tableExport, but it does not work either. Does anyone have an example of a Oracle DB package that creates html/javascript to perform a download of an html table to Excel. We are required to use Internet Explorer as our browser. Thanks in advance for any help.

           

          Mark

          From Excel, you can connect directly to Oracle DB via ODBC & issue SQL directly so why is javascript  needed at all?

           

          LMGTFY

          • 3. Re: Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.
            Andrew Sayer

            22997c30-b0a1-473e-a81c-2b0179782ee9 wrote:

             

            So we have a Oracle DB on a Linux server (Oracle 12c). We use database packages to build html code that users can use to view various information on the webpages. One of our webpages uses an old vbscript function to download a table to excel. The export works except in Windows 10 which we are now upgrading to for all our user workstations. I have attempted several solutions using javascript in the html code, but none of my attempts have worked. I have also tried using jquery pluigin tableExport, but it does not work either. Does anyone have an example of a Oracle DB package that creates html/javascript to perform a download of an html table to Excel. We are required to use Internet Explorer as our browser. Thanks in advance for any help.

             

            Mark

            What does not working actually mean?

            What error messages do you see?

             

            PL/SQL has no way of writing files on a client system (unless the client system shares its directories to the DB server which is probably not what you do). So what exactly does the writing?

             

            If your pl/sql code returns the file as a clob then a client should easily be able to spool it to a file. Or pl/sql can just write the file to the db server, you can then set up some way of obtaining that file from the client using things like ftp or maybe even use utl_smtp to send the file via email.

             

            However, if you had a process that worked and if you've only changed the client OS then most likely some of the configuration required on the client side is missing.

            • 4. Re: Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.
              3537569

              Our Linux server uses Perl/html to create the website, but some of the pages are created from our Oracle DB packages with PL/SQL.  Here is the code in the package body I am trying to use, but gives an error in Windows 10 "Automation Server Can't Create Object"  which is a security setting for the workstations.  We can't change our security settings on the user workstations so we need to find another way to have the webpage download the info to Excel.  The PL/SQL basically creates a html table of information that is displayed, and the code below is called when a button is pressed on the screen.  The variable htp_out is basically all html that is returned to the server and rendered on the screen.

               

              htp_out := htp_out || CHR(13) || '  <script type="text/javascript">

                 function fnExcelReport() {

               

                    var thisTable = document.getElementById("reportData").innerHTML;

                    window.clipboardData("Text", thisTable);

                    var objExcel = new ActiveXObject ("Excel.Application");

                    objExcel.visible = true;

               

                    var objWorkbook = objExcel.Workbooks.Add;

                    var objWorksheet = objWorkbook.Worksheets(1);

                    objWorksheet.Paste;

                 }

                </script>';

               

               

               

               

               

               

               

               

              • 5. Re: Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.
                jgarry

                I think the only answer is to change the security controls on the workstation.  I wouldn't know anything about it, but this seems to be what to do: https://www.pingzic.net/how-to-enable-activex-in-windows-10/

                • 6. Re: Oracle DB package creates html code for downloading html table to excel - Not working in Win 10.
                  Billy~Verreynne

                  3537569 wrote:

                   

                  var objExcel = new ActiveXObject ("Excel.Application");

                   

                   

                  Seriously!?? ActiveX inside a browser?

                   

                  Cripes. Your company must be living in a security lala land, devoid of any bad people such as hackers, and blissfully ignorant of what browser security entails. Or else your company is likely just plain bloody stupid.

                   

                  You are using 90's IE technology that has NO PLACE in today's ITS landscape. Very likely, not supported any more by Windows 10 out-of-the-box as even Microsoft eventually start to apply rudimentary security fundamentals. Even if decades too late.

                   

                  ActiveX is wrong. All wrong. So wrong that it is an offence that should be addressed via wielding a virtual lead pipe.