示例#1
0
        public override StdExcelWorkSheetBase InsertSheet(string sheetName)
        {
            ExcelWorksheet worksheet   = _epWorkbook.Worksheets.Add(sheetName);
            EpWorksheet    epworksheet = new EpWorksheet(worksheet);

            _workSheets.Add(epworksheet);
            return(epworksheet);
        }
示例#2
0
        protected override void ReadWorkbook(string fileName)
        {
            if (!File.Exists(fileName))
            {
                throw new Exception(string.Format("The file: {0} does not exists", fileName));
            }
            ExcelPackage package = new ExcelPackage(new FileInfo(fileName));

            _epWorkbook = package.Workbook;
            foreach (var worksheet in _epWorkbook.Worksheets)
            {
                EpWorksheet epWorksheet = new EpWorksheet(worksheet);
                _workSheets.Add(epWorksheet);
            }
        }