示例#1
0
 public virtual IEnumerable <ExcelDoubleCellValue> ConvertArgs(bool ignoreHidden, bool ignoreErrors, IEnumerable <FunctionArgument> arguments, ParsingContext context)
 {
     return(base.FuncArgsToFlatEnumerable(arguments, (arg, argList) =>
     {
         if (arg.IsExcelRange)
         {
             foreach (var cell in arg.ValueAsRangeInfo)
             {
                 if (!ignoreErrors && cell.IsExcelError)
                 {
                     throw new ExcelErrorValueException(ExcelErrorValue.Parse(cell.Value.ToString()));
                 }
                 if (!CellStateHelper.ShouldIgnore(ignoreHidden, cell, context) && ConvertUtil.IsNumeric(cell.Value))
                 {
                     var val = new ExcelDoubleCellValue(cell.ValueDouble, cell.Row);
                     argList.Add(val);
                 }
             }
         }
         else
         {
             if (!ignoreErrors && arg.ValueIsExcelError)
             {
                 throw new ExcelErrorValueException(arg.ValueAsExcelErrorValue);
             }
             if (ConvertUtil.IsNumeric(arg.Value) && !CellStateHelper.ShouldIgnore(ignoreHidden, arg, context))
             {
                 var val = new ExcelDoubleCellValue(ConvertUtil.GetValueDouble(arg.Value));
                 argList.Add(val);
             }
         }
     }));
 }
示例#2
0
 protected bool ShouldIgnore(ExcelDataProvider.ICellInfo c, ParsingContext context)
 {
     if (CellStateHelper.ShouldIgnore(IgnoreHiddenValues, c, context))
     {
         return(true);
     }
     if (IgnoreErrors && c.IsExcelError)
     {
         return(true);
     }
     return(false);
 }
示例#3
0
 public virtual IEnumerable <object> ConvertArgs(bool ignoreHidden, IEnumerable <FunctionArgument> arguments, ParsingContext context)
 {
     return(base.FuncArgsToFlatEnumerable(arguments, (arg, argList) =>
     {
         if (arg.Value is ExcelDataProvider.IRangeInfo)
         {
             foreach (var cell in (ExcelDataProvider.IRangeInfo)arg.Value)
             {
                 if (!CellStateHelper.ShouldIgnore(ignoreHidden, cell, context))
                 {
                     argList.Add(cell.Value);
                 }
             }
         }
         else
         {
             argList.Add(arg.Value);
         }
     })
            );
 }
 protected bool ShouldIgnore(ExcelDataProvider.ICellInfo c, ParsingContext context)
 {
     return(CellStateHelper.ShouldIgnore(IgnoreHiddenValues, c, context));
 }
示例#5
0
 internal static bool ShouldIgnore(bool ignoreHiddenValues, ExcelDataProvider.ICellInfo c, ParsingContext context)
 {
     return((ignoreHiddenValues && c.IsHiddenRow) || (context.Scopes.Current.IsSubtotal && CellStateHelper.IsSubTotal(c, context)));
 }