6 Replies Latest reply on Mar 7, 2007 8:40 AM by emmim44

    Read Excel Data

    emmim44 Level 1
      I am able to read through the excel file up to 15 rows...after the there is nothing what could be possible wrong ? Any help

        • 1. Re: Read Excel Data
          ksmith Level 1
          Have you tested against multiple excel files? Do that? Create a simple 2 column 20 row spreadsheet and test. If you are not seeing OOMemory errors, perhaps you are hitting a null which is interpreted as end-of-file.

          If you are working with some version of CFMX, Apache POI may be a better solution then COM. It allows you to do the msoffice COM APIs thru java classes. It is much better suited to cfmx then COM. POI is already distributed in CFMX7 and how cfreport outputs excel.
          • 2. Re: Read Excel Data
            emmim44 Level 1
            What is Apache POI ?
            We are not allowed to install any Ms Office on our server that is why I used the com object. I will try using a test file, you are right..
            And How will I check the end of file ?
            Thx
            • 3. Re: Read Excel Data
              insuractive Level 3
              Apache POI is a java package that allows you to read/write to excel files without having to create a datasource or connect via COM. As Ken mentioned - the POI package comes already installed with most versions of CFMX. We actually use the tool a fair amount, and I have seen some CFML wrappers for the Java tool floating around on the forum threads.

              Take a look at the official site for some examples on how to use it:

              http://jakarta.apache.org/poi/hssf/index.html

              • 4. Re: Read Excel Data
                emmim44 Level 1
                Thank you.

                I believe that I found the mistake on excel file..If any cell data starts with a number or a string value, the next cell under the same column should be same type...But I dont know how to fix in code wise...Any help will be appreaciated...

                Example: The below wont work.
                12
                13
                R-1
                This will work:
                1
                2
                3
                This wont work
                R-11
                3
                3
                • 5. Re: Read Excel Data
                  insuractive Level 3
                  Are there any special characters on line 16 that could cause the problem. Again, you're probably better off going with Jakarta POI, as it is java based and already on your server if you are using CFMX 6 or 7.

                  Take a look at:

                  http://www.bennadel.com/index.cfm?dax=blog:474.view

                  or do a google search for ColdFusion POI
                  • 6. Re: Read Excel Data
                    emmim44 Level 1
                    ok..I will try that...thx