NPOI.XSSF.UserModel.XSSFWorkbook.GetSheet C# (CSharp) Method

GetSheet() public method

public GetSheet ( String name ) : ISheet
name String
return ISheet
        public ISheet GetSheet(String name)
        {
            foreach (XSSFSheet sheet in sheets)
            {
                if (name.Equals(sheet.SheetName, StringComparison.InvariantCultureIgnoreCase))
                {
                    return sheet;
                }
            }
            return null;
        }

Usage Example

 public XLSXPlugin(string contentFormat, string contentEncoding, string currentFile, string currentWorkingDirectory)
 {
     this.contentFormat = new ContentType(contentFormat, contentEncoding);
     this.currentFile = currentFile;
     fileInput = new FileStream(Path.Combine(currentWorkingDirectory, this.currentFile), FileMode.Open, FileAccess.Read);
     workBook = new XSSFWorkbook(this.fileInput);
     currentPageName = currentFile.Substring(this.currentFile.LastIndexOf("/") + 1, this.currentFile.LastIndexOf("."));
     this.currentWorkingDirectory = currentWorkingDirectory;
     sheet = workBook.GetSheet("Sheet1");
     cmsBlockFactory = new CMSBlockFactory(currentPageName);
     processDataRows();
 }
All Usage Examples Of NPOI.XSSF.UserModel.XSSFWorkbook::GetSheet