1 2 3 Previous Next 146 Replies Latest reply on Dec 3, 2009 6:18 AM by user786836

    Export Excel instead of .csv

    Denes Kubicek
      I am just working on a package for extracting an excel file directly instead of .csv. I am
      interested to know if there are problems for any of you to get a clean export. Please
      have a look here and try it out:


      I appreciate your feedback.

      Denes Kubicek
        • 1. Re: Export Excel instead of .csv
          That is slick. It worked fine using Firefox v1.0, Excel 2003, on Windows XP. I got the normal Open or Save to disk dialog.

          I will ask the obvious, "How'd you do it?"

          • 2. Re: Export Excel instead of .csv
            Arie Geller
            Hello Denes,

            I've tried it with IE7 and Excel 2003 and it seems to work just fine.

            Well done,
            • 3. Re: Export Excel instead of .csv
              Works great Denes!

              Is it also possible to upload an .xls instead of .csv?
              (like Vikas does with .csv here http://htmldb.oracle.com/pls/otn/f?p=38131:1)
              • 4. Re: Export Excel instead of .csv
                Works great on Excel 2007, FF2 and Vista.

                great job Denes.

                • 5. Re: Export Excel instead of .csv
                  Hi Denes,

                  I have Excel 2000 and IE 6.0. Works super.
                  Your Excel looks as if you applied VBA method Coulmn.AutoFit.
                  • 6. Re: Export Excel instead of .csv
                    Denes Kubicek

                    It is easy - I generate html.

                    I made a demo package available here:


                    for testing. As soon as I'm done with it I will open it for modifications. The package is
                    generic (let us say in 95% of the cases it should work). I didn't test it with PL/SQL
                    reports but I doubt it will work with those. However, it should work with all normal
                    reports. The how - to is also attached.

                    Basically, you need to create three application items and one conditional page process.
                    After that, you may create links for exporting to excel as you do it with .csv.

                    Your feedback is welcome.

                    Denes Kubicek
                    • 7. Re: Export Excel instead of .csv
                      Hi Denes;

                      It seems that i don't have clean export. I got the following messages:

                      Problem During download. Problem came up in the following areas during load:

                      missing file: c:\i\css\core_v22.css
                      missing file: c:\i\themes\theme_9\theme_V2.css

                      Please note that APEX is installed on my D drive.

                      • 8. Re: Export Excel instead of .csv
                        Denes Kubicek
                        I noticed that this happens when you forget to:

                        1. pass the right report title

                        2. forget to pass the page parameter on which report is located or pass the wrong page

                        I still need some time to clean up the package so mistakes like these get handeled.

                        What is your name? I think it would be fair if you would sign your postings :)

                        Denes Kubicek
                        • 9. Re: Export Excel instead of .csv
                          Hi Denes,

                          i downloaded the package from your page, but i have trouble getting it to work on Oracle XE.

                          When i try to install the package i get the message that the body was created with a warning.

                          This is the output of show errors:

                          Fehler bei PACKAGE BODY EXPORT_EXCEL_PKG:

                          LINE/COL ERROR
                          -------- -----------------------------------------------------------------
                          255/7 PL/SQL: SQL Statement ignored
                          257/14 PL/SQL: ORA-00942: Tabelle oder View nicht vorhanden

                          Thanks for help in advance,
                          • 10. Re: Export Excel instead of .csv
                            Hi Denes,

                            It looks very nice... although I haven't got it running yet :)

                            I think there is a small error in the sql file
                            CREATE OR REPLACE PACKAGE BODY developer.export_excel_pkg wrapped
                            The schema name should not be there... right?

                            • 11. Re: Export Excel instead of .csv
                              I downloaded and installed the package.
                              When trying to download a report to Excel I received the following error:
                              ORA-01422: exact fetch returns more than requested number of rows / -1422

                              BTW, looks very nice.

                              • 12. Re: Export Excel instead of .csv
                                Denes Kubicek
                                I am still working on this package. Probably, you have two reports on the same page
                                having the same title?

                                I corrected the package and I use now region_id instead of the title.

                                The package works for ApEx 2.2 and higher - it is looking for the region source and
                                using it to generate the report.

                                For XE and lower versions, there is no such view where you could get the region source
                                information (as far as I know) and for those purposes, I would need to create a separate
                                package which would require some select grants on the corresponding tables.

                                Eventually, if I have some spare time, I will provide that package.

                                Denes Kubicek
                                • 13. Re: Export Excel instead of .csv
                                  You were wright. I had two regions having the same title.
                                  But now I'm receiving the following error:
                                  Report Header Error: ORA-00942: table or view does not exist / -942

                                  • 14. Re: Export Excel instead of .csv
                                    Denes Kubicek
                                    Life could be easier. Couldn't it?

                                    This error is because you are using either a lower version of ApEx or XE. In the readme
                                    of my demo it says it works on 2.2 and higher only.

                                    However, it was easier to get it working for XE. I provided a download link for XE here:


                                    I did some basic testing only and it worked. You need to follow the instructions carefully
                                    since some grants are required prior to installing anything.

                                    Denes Kubicek
                                    1 2 3 Previous Next