Esempio n. 1
0
        public void TestEvaluateAllInWindow()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet    s  = wb.CreateSheet() as SXSSFSheet;

            s.CreateRow(0).CreateCell(0).CellFormula = (/*setter*/ "1+2");
            s.CreateRow(1).CreateCell(1).CellFormula = (/*setter*/ "A1+10");
            s.CreateRow(2).CreateCell(2).CellFormula = (/*setter*/ "B2+100");

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();

            eval.EvaluateAll();

            Assert.AreEqual(3, (int)s.GetRow(0).GetCell(0).NumericCellValue);
            Assert.AreEqual(13, (int)s.GetRow(1).GetCell(1).NumericCellValue);
            Assert.AreEqual(113, (int)s.GetRow(2).GetCell(2).NumericCellValue);

            wb.Close();
        }
Esempio n. 2
0
        public IEvaluationCell GetCell(int rowIndex, int columnIndex)
        {
            SXSSFRow row = (SXSSFRow)_xs.GetRow(rowIndex);

            if (row == null)
            {
                if (rowIndex <= _xs.LastFlushedRowNumber)
                {
                    throw new RowFlushedException(rowIndex);
                }
                return(null);
            }
            SXSSFCell cell = (SXSSFCell)row.GetCell(columnIndex);

            if (cell == null)
            {
                return(null);
            }
            return(new SXSSFEvaluationCell(cell, this));
        }