Class FormulaParserManager¶
Namespace: OfficeOpenXml.FormulaParsing
Assembly: EPPlus.dll
Provides access to various functionality regarding excel formula evaluation.
Inheritance¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Methods¶
AddOrReplaceFunction(string, ExcelFunction)¶
If the supplied functionName does not exist, the supplied
functionImpl implementation will be added to the formula parser.
If it exists, the existing function will be replaced by the supplied functionImpl
Parameters¶
functionName string
functionImpl ExcelFunction
AttachLogger(IFormulaParserLogger)¶
Attaches a logger to the FormulaParser.
Parameters¶
logger IFormulaParserLogger
An instance of IFormulaParserLogger
AttachLogger(FileInfo)¶
Attaches a logger to the formula parser that produces output to the supplied logfile.
Parameters¶
logfile FileInfo
CopyFunctionsFrom(ExcelWorkbook)¶
Copies existing ExcelFunction´s from one workbook to another.
Parameters¶
otherWorkbook ExcelWorkbook
The workbook containing the forumulas to be copied.
DetachLogger()¶
Detaches any attached logger from the formula parser.
GetCalculationChain(ExcelRangeBase)¶
Get calculation chain
Parameters¶
range ExcelRangeBase
Returns¶
GetCalculationChain(ExcelRangeBase, ExcelCalculationOption)¶
Get Calculation chain
public IEnumerable<IFormulaCellInfo> GetCalculationChain(ExcelRangeBase range, ExcelCalculationOption options)
Parameters¶
range ExcelRangeBase
options ExcelCalculationOption
Returns¶
GetImplementedFunctionNames()¶
Returns an enumeration of the names of all functions implemented, both the built in functions and functions added using the LoadFunctionModule method of this class.
Returns¶
Function names in lower case
GetImplementedFunctions()¶
Returns an enumeration of all implemented functions, including the implementing ExcelFunction instance.
Returns¶
IEnumerable<KeyValuePair<string, ExcelFunction>>
An enumeration of KeyValuePair, where the key is the function name
LoadFunctionModule(IFunctionModule)¶
Loads a module containing custom functions to the formula parser. By using this method you can add your own implementations of Excel functions, by implementing a IFunctionModule.
Parameters¶
module IFunctionModule
A IFunctionModule containing ExcelFunctions.
Parse(string)¶
Parses the supplied formula and returns the result.
Parameters¶
formula string
The formula to parse
Returns¶
The result of the parsed formula
Parse(string, string, bool)¶
Parses the supplied formula and returns the result.
Parameters¶
formula string
The formula to parse
address string
The full address in the workbook where the formula should be parsed. Example: you might want to parse the formula of a conditional format, then this should be the address of the cell where the conditional format resides.
writeToCell bool
If writing result to adress or not, true by default
Returns¶
The result of the parsed formula