What kind of operations are you using to retrieve the contents? When we
read from a spreadsheet, which we don't do often enough for me to know if
A1 is an issue, we use the following code. If you're not testing and using
the ssCell_getNumericCellValue, you might have an issue:


row = ssSheet_getRow(sheet: RowNum);

cell = ssRow_GetCell(row: Col);



if cell<>*null;

type = ssCell_getCellType(cell);



select;

when type = CELL_TYPE_NUMERIC;

Num = ssCell_getNumericCellValue(cell);



when type = CELL_TYPE_STRING;

Txt = String_getBytes(ssCell_getStringCellValue(cell));



when type = CELL_TYPE_FORMULA;

Txt= String_getBytes(ssCell_getCellFormula(cell));



when type = CELL_TYPE_BLANK;

endsl;

endif;





From: Brian Kelly <brian.kelly@xxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Date: 06/26/2015 02:22 PM
Subject: POI - Index Out of Bounds when Cell A1 is numeric (XSSF)
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I am using POI and Scott Klement's utility programs [
http://www.scottklement.com/poi/] to parse excel spreadsheets from within
an RPG program. I have noticed that I can consistently get the following
error if Cell A1 on the spreadsheet is numeric (Excel type Generic or
Numeric), but can not get the error if cell A1 is an Excel data type of
String. I have gone to the point of using the same spreadsheet and putting
a number in cell A1, watch it fail, and then prefix the number with a ' to
designate it as a string and watch it work.

Here is the error I am seeing:
Message..... : Java exception received when calling Java method.
Cause...... : RPG procedure XLPARSE_WO in program ASPBEV1113/XLPARSER4
received Java execption "java.lang.IndexOutOfBoundsException: Index: 0,
Size: 0 when calling method "parse" with signature "([B)V" in class
"com.iseriesnetwork.clubtech.xlparse.ParseSheetXssf".


I have been able to reproduce this only with the XLSX document types, which
I believe use XSSF instead of HSSF.

My question is has anyone ran across this issue prior and knows of any ways
to work around this?

I am currently using POI version 3.10 (poi-3.10-FINAL-20140208.jar), and
can get everything else to work fine but this scenario. I have attempted
to put a newer version of POI into our iSeries IFS to see if something
recently fixed this issue but am also unsure if I did that right at this
point. We have it setup so that the POI data is in
/qibm/UserData/Java400/ext directory, and dropping the 3.12 Jar files into
that directory didn't seem to do the trick.

Any help or ideas that I can check would be greatly appreciated. The
utility program and POI we find very useful.


Thanks.

--
***** Register today for the 2015 VIP Users Conference on September 17 &
18.
Visit the UC homepage
<https://www.vtinfo.com/documents/other_public/uc2015.htm> for all the
details and to register. *****

Brian Kelly
Project Management - Blue Room Development Team
Vermont Information Processing

--
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or company to whom they are addressed.

Do not disclose, distribute, or copy this email to others outside your
company. If you have received this email in error, please notify the sender

immediately and delete this email from your system.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.