FormulaFunction Class

Base class for formula functions that provides common functionality for evaluation.

Inheritance

Object

Documents.Spreadsheet.FormulaFunction

Namespace: Radzen.Documents.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public abstract class FormulaFunction

Constructors

FormulaFunctionlink

Base class for formula functions that provides common functionality for evaluation.

Declaration
protected FormulaFunction()

Properties

CanHandleErrorslink

Gets a value indicating whether this function can handle error arguments. Functions that return true will receive error values as arguments instead of having evaluation short-circuited.

Declaration
public bool CanHandleErrors { get; }
Property Value
Type Description
boolGets a value indicating whether this function can handle error arguments. Functions that return true will receive error values as arguments instead of having evaluation short-circuited.

CoerceLiteralBooleanslink

Gets a value indicating whether literal boolean arguments in sequences should be coerced to numbers (TRUE→1, FALSE→0) before evaluation. Excel coerces direct boolean constants (e.g. SUM(TRUE,1)→2) but skips booleans from cell references (e.g. SUM(A1)→0 when A1=TRUE).

Declaration
public bool CoerceLiteralBooleans { get; }
Property Value
Type Description
boolGets a value indicating whether literal boolean arguments in sequences should be coerced to numbers (TRUE→1, FALSE→0) before evaluation. Excel coerces direct boolean constants (e.g. SUM(TRUE,1)→2) but skips booleans from cell references (e.g. SUM(A1)→0 when A1=TRUE).

Namelink

Gets the name of the function.

Declaration
public string Name { get; }
Property Value
Type Description
stringGets the name of the function.

Parameterslink

Gets the parameter definitions for this function.

Declaration
public Documents.Spreadsheet.FunctionParameter[] Parameters { get; }
Property Value
Type Description
Documents.Spreadsheet.FunctionParameter[]Gets the parameter definitions for this function.

Methods

Evaluatelink

Evaluates the function with the given arguments.

Declaration
public abstract Documents.Spreadsheet.CellData Evaluate(Documents.Spreadsheet.FunctionArguments arguments)
Parameters
Type Name Description
Documents.Spreadsheet.FunctionArguments arguments The function arguments organized by parameter name.
Returns
Type Description
Documents.Spreadsheet.CellDataThe result value wrapped in CellData.

TryGetIntegerlink

Tries to get an integer parameter from the function arguments.

Declaration
protected static bool TryGetInteger(Documents.Spreadsheet.FunctionArguments arguments, string parameterName, bool isRequired, int? defaultValue, Int32& value, Documents.Spreadsheet.CellData& error)
Parameters
Type Name Description
Documents.Spreadsheet.FunctionArguments arguments The function arguments organized by parameter name.
string parameterName The name of the parameter to get.
bool isRequired Whether the parameter is required.
int? defaultValue The default value if the parameter is not provided.
Int32& value The integer value of the parameter.
Documents.Spreadsheet.CellData& error The error value if the parameter is not an integer.
Returns
Type Description
bool

TryGetNumberlink

Tries to get a numeric parameter from the function arguments, coercing booleans and numeric text.

Declaration
protected static bool TryGetNumber(Documents.Spreadsheet.FunctionArguments arguments, string parameterName, bool isRequired, double? defaultValue, Double& value, Documents.Spreadsheet.CellData& error)
Parameters
Type Name Description
Documents.Spreadsheet.FunctionArguments arguments
string parameterName
bool isRequired
double? defaultValue
Double& value
Documents.Spreadsheet.CellData& error
Returns
Type Description
bool

TryGetStringlink

Tries to get a string parameter from the function arguments.

Declaration
protected static bool TryGetString(Documents.Spreadsheet.FunctionArguments arguments, string parameterName, String& text, Documents.Spreadsheet.CellData& error)
Parameters
Type Name Description
Documents.Spreadsheet.FunctionArguments arguments The function arguments organized by parameter name.
string parameterName The name of the parameter to get.
String& text The string value of the parameter.
Documents.Spreadsheet.CellData& error The error value if the parameter is not a string.
Returns
Type Description
boolTrue if the parameter is a string, false otherwise.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙