How to read single value from merged cells

2007-01-08 Thread Karr, David
I haven't used POI in a long time, and I need to throw something together pretty quickly to read specific data out of a somewhat complicated spreadsheet. In the spreadsheet, I'm going to need to read a value from each of many merged cell blocks. When I view the sheet in Excel, the value is at

Problems getting ? out of Excel cell

2007-01-11 Thread Karr, David
I have a spreadsheet with cells that have values like ≤ and ≥. I guess these are unicode, but I'm not certain. When I read these values with HSSFCell.getStringCellValue(), it seems to corrupt those characters. Is there anything reasonable I can do about this?

RE: Problems getting ? out of Excel cell

2007-01-11 Thread Karr, David
Never mind. This isn't a POI problem. I'm having trouble using Writer to write these characters out. It seems to corrupt these characters when I write them out, or perhaps I'm getting confused about file encodings. -Original Message- From: Karr, David Sent: Thursday, January 11

How to determine what color a cell is from the style color index?

2007-03-10 Thread Karr, David
I'm reading a spreadsheet, and I have a cell and it's cellstyle, so I can get the fillbg index. How do I tell what color that is? I can't even figure it out by looking at the Constant Field Values link in the javadoc. A cell that appears to be white shows a value of 65, and a cell that appears

Confused about reading fill pattern

2007-03-14 Thread Karr, David
In my spreadsheet, I have a sample region of rows in a single column where the first row has the value A, and the cell has a white background. The rest of the cells in the column are grey, and are in a single merged region. So, when I click on the A cell, it focuses on just that cell. When I

RE: How to determine what color a cell is from the style color index?

2007-03-16 Thread Karr, David
If anyone's wondering, I gave up on this approach. It's more effective to use merged regions. -Original Message- From: Karr, David Sent: Saturday, March 10, 2007 11:57 AM To: POI Users List Subject: How to determine what color a cell is from the style color index? I'm reading

POI251: Worked fine reading one spreadsheet, new one throws RecordFormatException creating workbook

2007-03-27 Thread Karr, David
I have an app using POI 2.5.1 that reads a spreadsheet and generates some other files from it (in text files). I had it working with one version of the spreadsheet. I now have a new version of the spreadsheet that is similar, but slightly different. I need to update the app to use the new

RE: How to read just one sheet out of a large excel file?

2007-03-27 Thread Karr, David
The options -Xms -Xmx are intended to be supplied with actual memory values. Specifying -Xmx by itself doesn't do any good. You might try -Xmx1024m. -Original Message- From: Matthias Knapp [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 27, 2007 2:54 AM To:

RE: POI251: Worked fine reading one spreadsheet, new one throws RecordFormatException creating workbook

2007-03-27 Thread Karr, David
that I'm aware of (besides simple differences like column names and content). -Original Message- From: Karr, David Sent: Tuesday, March 27, 2007 3:23 PM To: POI Users List Subject: POI251: Worked fine reading one spreadsheet, new one throws RecordFormatException creating workbook

RE: POI251: Worked fine reading one spreadsheet, new one throws RecordFormatException creating workbook

2007-03-27 Thread Karr, David
I noticed from a FAQ entry that this could happen if the spreadsheet uses Excel features not supported by POI. Is there anything I can look at in Excel that will give me a clue on this? -Original Message- From: Karr, David Sent: Tuesday, March 27, 2007 3:23 PM To: POI Users List

RE: POI251: Worked fine reading one spreadsheet, new one throws RecordFormatException creating workbook

2007-03-27 Thread Karr, David
RecordFormatException creating workbook You might try the latest 3.0 RC1 at http://people.apache.org/~nick/ POI-3.0-RC1/ I know that bugs related to macros were repaired in the last couple of months. Regards, Dave On Mar 27, 2007, at 6:01 PM, Karr, David wrote: I noticed from a FAQ entry

Why does POI javadoc not include scratchpad classes?

2007-03-29 Thread Karr, David
I noticed that the javadoc for POI does not include the scratchpad classes. Is this intentional? Is the Javadoc for these classes provide somewhere else? - To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List:

Getting class file has wrong version error on poi-scratchpad-3.0-rc2 jar

2007-03-29 Thread Karr, David
I'm trying to use 3.0rc2, and I'm trying to use the scratchpad jar for the first time. I'm using JDK 1.4.2. When I try to compile my code with Ant, I get the following: bad class file: ...\lib\poi-3.0-rc2-20070329.jar(org/apache/poi/hssf/model/Workbook.clas s) class file has wrong version 49.0,

RE: Getting class file has wrong version error on poi-scratchpad-3.0-rc2 jar

2007-03-29 Thread Karr, David
Obviously, I was wrong to refer to this as the scratchpad jar. It's the main poi jar. -Original Message- From: Karr, David Sent: Thursday, March 29, 2007 12:06 PM To: POI Users List Subject: Getting class file has wrong version error on poi-scratchpad-3.0-rc2 jar I'm trying

HSSFFormulaEvaluator.evaluate(cell) fails with NPE because row is not set

2007-03-29 Thread Karr, David
Is the formula evaluation code in the scratchpad supposed to work? I tried to evaluate a formula in a cell, but it gets the following exception: java.lang.NullPointerException at org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.internalEvaluate(HSSF FormulaEvaluator.java:293)

Formula Evaluator fails on #REF instead of number

2007-03-29 Thread Karr, David
Using 3.0rc2, the formula evaluator failed on a particular cell, with the stacktrace following this. Before I file an issue for this, is this expected to fail this way? Is there any workaround I can implement? Error: Integer Expected java.lang.RuntimeException: Cannot Parse, sorry : Integer

RE: Formula Evaluator fails on #REF instead of number

2007-03-29 Thread Karr, David
Never mind, we've changed the formula to something more reasonable, and it's able to process it. -Original Message- From: Karr, David Sent: Thursday, March 29, 2007 1:26 PM To: POI Users List Subject: Formula Evaluator fails on #REF instead of number Using 3.0rc2, the formula

RE: Getting class file has wrong version error on poi-scratchpad-3.0-rc2 jar

2007-03-29 Thread Karr, David
: That class file was compiled with JDK 5.0 See http://blogs.sun.com/sundararajan/entry/java_class_ic_errors On Mar 29, 2007, at 2:25 PM, Karr, David wrote: Obviously, I was wrong to refer to this as the scratchpad jar. It's the main poi jar. -Original Message- From: Karr

RE: Getting class file has wrong version error on poi-scratchpad-3.0-rc2 jar

2007-03-30 Thread Karr, David
that 1.5 isn't available for? Karr, David wrote: I assume you're only half serious. Dropping 1.4.2 at this point would be a big mistake. In any case, I tried manually building the jars from source with JDK 1.4.2, and it works fine. -Original Message- From: Andrew C

RE: empty cells with iterators

2007-04-03 Thread Karr, David
Perhaps you're looking to check whether the cell type is blank. Once you have a HSSFCell object, call getCellType() and compare it against HSSFCell.CELL_TYPE_BLANK. -Original Message- From: Hugo Osorio [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 8:50 AM To:

RE: Get column index by specifying Excel column index (i.e.C for col C)

2007-04-03 Thread Karr, David
You could give these a try. I didn't find this functionality in POI. private int colNameToNum(final String colName) { int result = 0; String lcColName = colName.toLowerCase(); for (int ctr = 0; ctr lcColName.length(); ++ ctr) result = (result *

RE: empty cells with iterators

2007-04-03 Thread Karr, David
seems not to be blank, but it still appears to have data despite it is empty... 2007/4/3, Karr, David [EMAIL PROTECTED]: Perhaps you're looking to check whether the cell type is blank. Once you have a HSSFCell object, call getCellType() and compare it against

RE: How to get String result from a cell with a formula behind

2007-04-04 Thread Karr, David
I'm new at this also, but you should probably use the org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator class from the scratchpad jar. -Original Message- From: ChrisHauser [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 8:49 AM To: poi-user@jakarta.apache.org Subject:

Also getting Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula exception

2007-05-18 Thread Karr, David
I would have responded to the original chain on this, but I already deleted that from my email. I just noticed a new exception in my POI-based application: Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula I tried downloading the latest release (the ftp