0
하나의 열에서 소수의 셀을 합산하는 xls 수식을 작성해야합니다. 그 공식의 XLS의 출력은 모양 :org.apache.poi xls의 수식 작성하기
SUM(F5;F9;F13;F16)
나는 org.apache.poi 라이브러리에 그 공식을 만들었습니다.
[FormulaParseException: Parse error near char 6 ';' in specified formula 'SUM(F5;F9;F13;F16)'. Expected ',' or ')']
당신은 나에게 어떤 조언을 줄 수 :
Cell cell = rowSum.createCell(j);
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
// column number like (A or B) in excel to use in formula
String x = CellReference.convertNumToColString(j);
cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
// for total sum row
String totalSumFormula = "SUM(";
for(int s=0; s<sumRowNumbers.size(); s++) {
int tempSumRowNumber = sumRowNumbers.get(s);
tempSumRowNumber++;
totalSumFormula += (x + tempSumRowNumber);
if(s+1 != sumRowNumbers.size()) {
totalSumFormula += ";";
} else {
totalSumFormula += ")";
}
}
cell.setCellFormula(totalSumFormula);
하지만 unfortunatelly 나는 내가 이해하지 못할 오류는 무엇입니까? 어떻게 처리할까요?
파일 형식이 오직 Excel에서 때때로 디스플레이를 localises 경우에도 미국 스타일 구분 기호/문자열에서 작동 – Gagravarr