//01 유효행을 구함 예: 엑셀에 값을 넣었다가 지웠으면 무효행으로 간주
/*
* 설명 :행을 루프돌아서 해당행의 셀중 하나의 셀이라도 타입이 CELL_TYPE_BLANK이 아니면 유효행으로 간주
* */
//****************************************************************************************
int rowCount = 0; //유효행
boolean isRealRow = false;
//메네츠엑셀파일은 제9행부터 데이타 있음,엑셀은 0부터 시작하기에 제8행부터
for(int row = 8 ; row < rows ; row++){
XSSFRow currentRow = sheet.getRow(row);
int physicalNumberOfCells = currentRow.getPhysicalNumberOfCells(); //해당행 셀의 개수를 구함
if(physicalNumberOfCells > 0){//해당행 셀의 개수가 0보다 클때
//셀 루프
for(int cell = 1; cell< physicalNumberOfCells;cell++){
XSSFCell cell2 = currentRow.getCell(cell);
int cellType = 0;
if(cell2!= null){
cellType = currentRow.getCell(cell).getCellType();
}
if(cellType != Cell.CELL_TYPE_BLANK){
isRealRow = true; //유효행으로 간주
break;
}
}
if(isRealRow){
rowCount++; //유효행
isRealRow = false;
}
}
}
//****************************************************************************************
/*
* 설명 :행을 루프돌아서 해당행의 셀중 하나의 셀이라도 타입이 CELL_TYPE_BLANK이 아니면 유효행으로 간주
* */
//****************************************************************************************
int rowCount = 0; //유효행
boolean isRealRow = false;
//메네츠엑셀파일은 제9행부터 데이타 있음,엑셀은 0부터 시작하기에 제8행부터
for(int row = 8 ; row < rows ; row++){
XSSFRow currentRow = sheet.getRow(row);
int physicalNumberOfCells = currentRow.getPhysicalNumberOfCells(); //해당행 셀의 개수를 구함
if(physicalNumberOfCells > 0){//해당행 셀의 개수가 0보다 클때
//셀 루프
for(int cell = 1; cell< physicalNumberOfCells;cell++){
XSSFCell cell2 = currentRow.getCell(cell);
int cellType = 0;
if(cell2!= null){
cellType = currentRow.getCell(cell).getCellType();
}
if(cellType != Cell.CELL_TYPE_BLANK){
isRealRow = true; //유효행으로 간주
break;
}
}
if(isRealRow){
rowCount++; //유효행
isRealRow = false;
}
}
}
//****************************************************************************************