Esempio n. 1
0
        SheetRefEvaluator CreateExternSheetRefEvaluator(int externSheetIndex)
        {
            ExternalSheet     externalSheet = _workbook.GetExternalSheet(externSheetIndex);
            WorkbookEvaluator targetEvaluator;
            int otherSheetIndex;

            if (externalSheet == null)
            {
                // sheet is in same workbook
                otherSheetIndex = _workbook.ConvertFromExternSheetIndex(externSheetIndex);
                targetEvaluator = _bookEvaluator;
            }
            else
            {
                // look up sheet by name from external workbook
                String workbookName = externalSheet.GetWorkbookName();
                try
                {
                    targetEvaluator = _bookEvaluator.GetOtherWorkbookEvaluator(workbookName);
                }
                catch (WorkbookNotFoundException)
                {
                    throw;
                }
                otherSheetIndex = targetEvaluator.GetSheetIndex(externalSheet.GetSheetName());
                if (otherSheetIndex < 0)
                {
                    throw new Exception("Invalid sheet name '" + externalSheet.GetSheetName()
                                        + "' in bool '" + workbookName + "'.");
                }
            }
            return(new SheetRefEvaluator(targetEvaluator, _tracker, otherSheetIndex));
        }
 /* package */
 internal int GetSheetIndexByExternIndex(int externSheetIndex)
 {
     return(_workbook.ConvertFromExternSheetIndex(externSheetIndex));
 }
Esempio n. 3
0
 public int ConvertFromExternSheetIndex(int externSheetIndex)
 {
     return(_masterBook.ConvertFromExternSheetIndex(externSheetIndex));
 }