Пример #1
0
        public string GetCellValueString(int index, string defaultValue)
        {
            ExcelCell cell = this.GetCell(index);

            if (cell == null || cell.Type == ExcelCellTypes.Null)
            {
                return(defaultValue);
            }

            return(cell.Value.ToString());
        }
Пример #2
0
        public double GetCellValueNumberic(int index, double defaultValue)
        {
            ExcelCell cell = this.GetCell(index);

            if (cell == null || cell.Type == ExcelCellTypes.Null)
            {
                return(defaultValue);
            }

            double value;

            if (!double.TryParse(cell.Value.ToString(), out value))
            {
                return(defaultValue);
            }
            else
            {
                return(value);
            }
        }