|
|
@@ -1255,4 +1255,34 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { |
|
|
|
assertEquals(1, ref.getLastCell().getRow()); |
|
|
|
assertEquals(0, ref.getLastCell().getCol()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Sum across multiple workbooks |
|
|
|
* eg =SUM($Sheet1.C1:$Sheet4.C1) |
|
|
|
* DISABLED As we can't currently evaluate these |
|
|
|
*/ |
|
|
|
public void DISABLEDtest48703() throws Exception { |
|
|
|
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48703.xlsx"); |
|
|
|
XSSFSheet sheet = wb.getSheetAt(0); |
|
|
|
|
|
|
|
// Contains two forms, one with a range and one a list |
|
|
|
XSSFRow r1 = sheet.getRow(0); |
|
|
|
XSSFRow r2 = sheet.getRow(1); |
|
|
|
XSSFCell c1 = r1.getCell(1); |
|
|
|
XSSFCell c2 = r2.getCell(1); |
|
|
|
|
|
|
|
assertEquals(20.0, c1.getNumericCellValue()); |
|
|
|
assertEquals("SUM(Sheet1!C1,Sheet2!C1,Sheet3!C1,Sheet4!C1)", c1.getCellFormula()); |
|
|
|
|
|
|
|
assertEquals(20.0, c2.getNumericCellValue()); |
|
|
|
assertEquals("SUM(Sheet1:Sheet4!C1)", c2.getCellFormula()); |
|
|
|
|
|
|
|
// Try evaluating both |
|
|
|
XSSFFormulaEvaluator eval = new XSSFFormulaEvaluator(wb); |
|
|
|
eval.evaluateFormulaCell(c1); |
|
|
|
eval.evaluateFormulaCell(c2); |
|
|
|
|
|
|
|
assertEquals(20.0, c1.getNumericCellValue()); |
|
|
|
assertEquals(20.0, c2.getNumericCellValue()); |
|
|
|
} |
|
|
|
} |