Class FormulaParserManager
Provides access to various functionality regarding excel formula evaluation.
Inheritance
Inherited Members
Namespace: OfficeOpenXml.FormulaParsing
Assembly: EPPlus.dll
Syntax
public class FormulaParserManager
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
Declaration
public void AddOrReplaceFunction(string functionName, ExcelFunction functionImpl)
Parameters
Type | Name | Description |
---|---|---|
System. |
functionName | |
Excel |
functionImpl |
AttachLogger(IFormulaParserLogger)
Attaches a logger to the Formula
Declaration
public void AttachLogger(IFormulaParserLogger logger)
Parameters
Type | Name | Description |
---|---|---|
IFormula |
logger | An instance of IFormula |
AttachLogger(FileInfo)
Attaches a logger to the formula parser that produces output to the supplied logfile.
Declaration
public void AttachLogger(FileInfo logfile)
Parameters
Type | Name | Description |
---|---|---|
System. |
logfile |
CopyFunctionsFrom(ExcelWorkbook)
Copies existing Excel
Declaration
public void CopyFunctionsFrom(ExcelWorkbook otherWorkbook)
Parameters
Type | Name | Description |
---|---|---|
Excel |
otherWorkbook | The workbook containing the forumulas to be copied. |
DetachLogger()
Detaches any attached logger from the formula parser.
Declaration
public void DetachLogger()
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.
Declaration
public IEnumerable<string> GetImplementedFunctionNames()
Returns
Type | Description |
---|---|
System. |
Function names in lower case |
GetImplementedFunctions()
Returns an enumeration of all implemented functions, including the implementing Excel
Declaration
public IEnumerable<KeyValuePair<string, ExcelFunction>> GetImplementedFunctions()
Returns
Type | Description |
---|---|
System. |
An enumeration of System. |
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 IFunction
Declaration
public void LoadFunctionModule(IFunctionModule module)
Parameters
Type | Name | Description |
---|---|---|
IFunction |
module | A IFunction |
Parse(String)
Parses the supplied formula
and returns the result.
Declaration
public object Parse(string formula)
Parameters
Type | Name | Description |
---|---|---|
System. |
formula |
Returns
Type | Description |
---|---|
System. |