poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15062] - hssf won't parse sheets bigger than 32 rows for certain sheets
Date Fri, 10 Jan 2003 12:47:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15062>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15062

hssf won't parse sheets bigger than 32 rows for certain sheets





------- Additional Comments From volker.tirjan@bundesbank.de  2003-01-10 12:47 -------
Hello,

I use jakarta-poi-1.9.0-dev-20021107 and encountered a similar problem: Each 
reference (=A1) leads to a wrong result of row.getLastRowNum(), if the 
referenced cell contains String data. The returned length of the sheet depends 
on the row in which the =reference was placed.

I send you some code and a Workbook, to demonstrate the mysteria: Sheet1 one has 
99 rows an Text in B1, sheets2 & 3 are also 99 rows long but have a reference to 
sheet1!B1 in B31/B32 (row numbering 0-based). As you will see the barrier 
seems to be always n*32 ...

If you need some more information, please contact me.
Have a good time,

Volker

===============================
Here's the very basic sample code:
(the referenced excel-sheet is Attachment #4393)
(The sample output follows after)

public static void poiFehler() {
	try {

		POIFSFileSystem fs = new POIFSFileSystem(new 
FileInputStream("C:\\tmp\\Mappe1.xls"));
       		 HSSFWorkbook wb = new HSSFWorkbook(fs);
		int x;
		int realLen=98;
		
		HSSFSheet sheet = wb.getSheet("Tabelle1");
		x = sheet.getLastRowNum();
		System.out.println("Tabelle1: Length="+realLen+", no 
String-reference");
		System.out.println("POI-LastRowNum="+x);
		if(realLen==x) System.out.println("OK");
		else System.out.println("BUG!!");
		System.out.println();

		System.out.println("Tabelle2: Length="+realLen+", 
String-reference in row 31 (or before)");	
		sheet = wb.getSheet("Tabelle2");
		x = sheet.getLastRowNum();		
		System.out.println("POI-LastRowNum="+x);
		if(realLen==x) System.out.println("OK");
		else System.out.println("BUG!!");
		System.out.println();

		System.out.println("Tabelle3: Length="+realLen+", 
String-reference in row 32 (or behind)");	
		sheet = wb.getSheet("Tabelle3");
		x = sheet.getLastRowNum();		
		System.out.println("POI-LastRowNum="+x);
		if(realLen==x) System.out.println("OK");
		else System.out.println("BUG!!");
		System.out.println();
		    
	} catch (IOException e) {
					
		System.out.println("IO-Exc.");
	}
		
}

------------------------------------------------

OUTPUT:
Tabelle1: Length=98, no String-reference
POI-LastRowNum=98
OK

Tabelle2: Length=98, String-reference in row 31 (or before)
POI-LastRowNum=31
BUG!!

Tabelle3: Length=98, String-reference in row 32 (or behind)
POI-LastRowNum=63
BUG!!

Mime
View raw message