Pat Flickner

Ranch Hand
+ Follow
since Nov 17, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pat Flickner

Thanks. I'll check it out. Appreciate the info.
Mr. Williams,

I've been doing HTML since its infancy and have only recently started playing around with HTML5. I see some things that look pretty cool, but is there something (as with Java) that can show you the distinct differences between the old HTML4 and HTML5? I'm especially interested in being able to have the pages provide the same information regardless of platform or browser (this is important because it's pretty annoying for everyone when an app or site works perfectly on one browser or platform but looks horrid or just plain doesn't work on another). Thanks. And I'm checking out the playn you recommended to another user. I love Google.

Pat
To start off, I found some information about reading Excel files via javascript, but none of the information I found seems to work as expected. This is what all I want to do (don't laugh):

  • Read an existing Excel spreadsheet that has been selected for upload
  • Go through the columns starting at row 2 to check for anything that is either mising that should exist or incorrect
  • Flag any of those columns (perhaps highlight), or if that's not possible, if I read it, I can display an error alert.


  • Now I get that it may be a little more complex than "all I want", but this is what I would like to be able to do. We had tested JExcel awhile back that would have done that via the back-end -- and I certainly am doing back-end validation -- but I would really like to have the user be able to make the needed changes prior to uploading since it will actually save a step (they currently get a notification that their request has been denied for validation errors). I figure if they could get their spreadsheet validated prior to uploading the spreadsheet, it woudl help eliminate the annoyance factor.

    Any help would greatly be appreciated. Thanks.


    SON OF A GUN!!! That did it. Here's my final portion (I actually had the xbean.jar (and possibly an older version that the one I downloaded and replaced it with), but I was missing the other things that were in the lib:

    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/jsr173_1.0_api.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/resolver.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/xbean_xpath.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/xmlbeans-qname.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/xmlpublic.jar"/>


    That did it! I added the other ones and I can now read xlsx files. Now I can play. YAY!
    I wish. I looked at the list of jar files I'm supposed to have on the Apache site and even added a few (like the dom4j.jar file - that isn't on the list). I'm getting a org.apache.poi.POIXMLException error: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException. The stack trace is null. There is no other information and it's driving me crazy. The only thing I don't have is thte xmlbean jar. I think that's right. I will try adding that and see if that works. It's the only thing I haven't tried (just came across that).
    I added the dom4j.jar to my classpath (found that somewhere, figured I'd try it) and now I'm getting "org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException". Am I missing a jar or something? Here's what I have besides my spring and struts jars:

    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-beanutils-1.8.0.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-collections-3.2.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-dbcp-1.2.2.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-digester-2.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-fileupload-1.2.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-io-1.4.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-jexl-2.0.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-lang-2.4.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-logging-1.1.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-logging-adapters-1.1.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-logging-api-1.1.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-pool-1.4.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/commons-validator-1.3.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/dom4j-full.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/junit-3.8.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/jxls-core-1.0-RC-2.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/jxls-reader-1.0-RC-2.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/log4j-1.2.16.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/ooxml-schemas-1.1.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/poi-3.7-20101029.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/poi-ooxml-3.7-20101029.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/poi-ooxml-schemas-3.7-20101029.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/poi-scratchpad-3.7-20101029.jar"/>
    <classpathentry kind="lib" path="Web Content/WEB-INF/lib/xbean.jar"/>

    I figue if I'm now getting another message, I must be missing something, or something I have is too old (or new) for the processes.
    By the way, I'm using eclipse Helios release 2 with the WebSphere jdk. I get the following error:

    I'm having some major difficulty here that I'm hoping someone can help me with. I've googled my brains out trying to find an answer that works, and am having no success. We are now standardized at Excel 2007 and our users want to not have to save the files as 97-2003 format just to read the file. The problem I'm having is that I'm using the apache struts FormFile. XSSF does not care for the InputStream with FormFile. I've tried creating a new FileInputStream using the full path (I extract that prior to uploading so that it's part of the ActionForm) and using the full path (which includes the filename) for creating the new Workbook. I've tried a variety of things, including using the WorkbookFactory. I'm at a loss. Everthing I see says it tells you how to read a 2007 Excel file, but all of their examples are for ".xls" files. I have no doubt they work, but I would like to see something for 2007+ format.

    Here's the code:



    Maybe I missed something, but I'm now pounding my head against a brick wall. This is my umpteenth iteration at trying something to make this work. I appreciate any information that may help. I'm willing to try anything, including standing on my head reciting Shakespeare. If that works, I'll take it.

    Pat Flickner
    poi-3.7-20101029.jar
    and I'm using tomcat 5.5 on eclipse ganymede - no jars except jconn3.jar, tools.jar, and bootstrap.jar are part of the global environment
    12 years ago
    And I just realized that sounded snarky. It wasn't. I've checked everything and can't figure out why the new stuff breaks.
    12 years ago
    Nope. Unfortunately, I removed all of the old and put in all of the new. Next?
    12 years ago
    Exactly what do you mean

    Make sure your code compiles against POI 3.7, and that the same libraries are used for compilation and at runtime.



    I pulled in the jars, recompiled my entire application, and made the changes to replace the deprecated methods, and then ran it. I'm no newbie, just looking to find out why I'm having issues.
    12 years ago
    (By the way, I did try using XSSF as well - wasn't much better)
    12 years ago
    I am having difficulty moving to the new process. I didn't have to change much using POI 3.7 (just removed the (short) casting) to replace the deprecated with the new methods, like row.getCell(). Yet, on the Busy Developer's Guide to HSSF and XSSF Features (https://coderanch.com/forums/jforum?module=posts&action=insert&forum_id=45 ), it shows the deprecated values.

    Anyway, when I upload a 97-2003 format spreadsheet (xls), I am erroring out on the line . It doesn't even hit the catch, just goes straight to an error with the explanation

    Caused by: java.lang.NoSuchMethodError: org/apache/poi/hssf/usermodel/HSSFRow.getCell(I)Lorg/apache/poi/hssf/usermodel/HSSFCell;

    followed by

    javax.servlet.ServletException: org/apache/poi/hssf/usermodel/HSSFRow.getCell(I)Lorg/apache/poi/hssf/usermodel/HSSFCell;

    .

    The reason I bring this up is because I was converting to use 2007+ .xlsx format spreadsheets and I was getting strange errors uploading those (and this got caught in the try/catch):

    Unable to process spreadsheet: Invalid header signature; read 1688935826934608, expected -2226271756974174256

    .

    When I looked up the error, everything said you had to update to POI 3.5 or later (I have 3.7), so I'm stumped. By both errors, actually. I stripped all formatting just to be certain that there was nothing funny in the spreadsheets that couldn't be handled. Help.


    12 years ago
    I am trying to get information out of a class and am looking to see if I can do it in a similar fashion that I do in JavaScript. In JavaScript, I can use the getElementById() method to pass a variable's name in and return the value of that variable. I have looked at several classes, the most recent Introspector, in the hopes that I can simply pass the variable's name in from a constant and have the process return me its method's value. To be exact, here's what I have:

    Constant:


    Processing Code:


    I'm using a Hashtable to map the variable name to the corresponding method:


    Is there a means of getting the values if I were to capitalize the first character and preface it with "get"? It would be so much simpler than typing in all that code. I've already done it for one program, but I would like to not EVER have to do that again (about 65 variables to code). I already have enough to do. Yes, I'm whining. Thanks.
    13 years ago