Ejemplo n.º 1
0
        public ExternalSheet GetExternalSheet(int externSheetIndex)
        {
            ExternalSheet sheet = _iBook.GetExternalSheet(externSheetIndex);

            if (sheet == null)
            {
                // Try to treat it as a local sheet
                int localSheetIndex = ConvertFromExternSheetIndex(externSheetIndex);
                if (localSheetIndex == -1)
                {
                    // The sheet referenced can't be found, sorry
                    return(null);
                }
                if (localSheetIndex == -2)
                {
                    // Not actually sheet based at all - is workbook scoped
                    return(null);
                }

                // Look up the local sheet
                String sheetName = GetSheetName(localSheetIndex);

                // Is it a single local sheet, or a range?
                int lastLocalSheetIndex = _iBook.GetLastSheetIndexFromExternSheetIndex(externSheetIndex);
                if (lastLocalSheetIndex == localSheetIndex)
                {
                    sheet = new ExternalSheet(null, sheetName);
                }
                else
                {
                    String lastSheetName = GetSheetName(lastLocalSheetIndex);
                    sheet = new ExternalSheetRange(null, sheetName, lastSheetName);
                }
            }
            return(sheet);
        }
Ejemplo n.º 2
0
 public ExternalSheet GetExternalSheet(int externSheetIndex)
 {
     return(_iBook.GetExternalSheet(externSheetIndex));
 }