NPOI.XSSF.UserModel.XSSFWorkbook.GetSheetIndex C# (CSharp) Метод

GetSheetIndex() публичный Метод

public GetSheetIndex ( ISheet sheet ) : int
sheet ISheet
Результат int
        public int GetSheetIndex(ISheet sheet)
        {
            int idx = 0;
            foreach (XSSFSheet sh in sheets)
            {
                if (sh == sheet) return idx;
                idx++;
            }
            return -1;
        }

Same methods

XSSFWorkbook::GetSheetIndex ( String name ) : int

Usage Example

Пример #1
0
        private void SetFormula(String formula, FormulaType formulaType)
        {
            XSSFWorkbook wb = (XSSFWorkbook)_row.Sheet.Workbook;

            if (formula == null)
            {
                RemoveFormula();
                return;
            }

            if (wb.CellFormulaValidation)
            {
                IFormulaParsingWorkbook fpb = XSSFEvaluationWorkbook.Create(wb);
                //validate through the FormulaParser
                FormulaParser.Parse(formula, fpb, formulaType, wb.GetSheetIndex(this.Sheet), RowIndex);
            }
            CT_CellFormula f = new CT_CellFormula();

            f.Value = formula;
            _cell.f = (f);
            if (_cell.IsSetV())
            {
                _cell.unsetV();
            }
        }
All Usage Examples Of NPOI.XSSF.UserModel.XSSFWorkbook::GetSheetIndex