I'm working with apache poi and now I have the following trouble. I'm including apache poi in my project in this way:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>
Now my problem is that I'm not able to get a correct number of rows, for example I have two files (Source file and UploadFile). The uploadFile is made select all in the Source file and paste all in the uploadFile. In that case the following snippet of code print 65535
XSSFSheet firstSheet = (XSSFSheet) wbUploaded.getSheetAt((short)0); //Foglio Luce
System.out.println(firstSheet .getLastRowNum());
//Read the sheet
for(Row row : sheetLuce){
//Do something
}
Also if my file is the following:
I understood that the problem depends from the way to make the file, why if I instead to select,copy and paste all, I select (on Source file) only the filled row and I copy them in the upload filethe number of rows is printed correctly. Now I want to ask you like poi manage the number of rows?