Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / DefaultSheetDataModel Class / EvaluateExpression Method
Row index of the base cell
Column index of the base cell
Expression to be evaluated

In This Topic
    EvaluateExpression Method (DefaultSheetDataModel)
    In This Topic
    Evaluates the expression in the cell at the specified row and column and returns the resulting object.
    Public Function EvaluateExpression( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal expression As Expression _
    ) As Object
    Dim instance As DefaultSheetDataModel
    Dim row As Integer
    Dim column As Integer
    Dim expression As Expression
    Dim value As Object
    value = instance.EvaluateExpression(row, column, expression)
    public object EvaluateExpression( 
       int row,
       int column,
       Expression expression


    Row index of the base cell
    Column index of the base cell
    Expression to be evaluated

    Return Value

    Object containing the evaluated result
    This example evaluates the specified expression.
    FarPoint.Web.Spread.Model.DefaultSheetDataModel dm;
    dm = FpSpread1.ActiveSheetView.DataModel;
    FarPoint.CalcEngine.Expression ex;
    object o; 
    FpSpread1.ActiveSheetView.Cells[0, 0].Value = 10; 
    FpSpread1.ActiveSheetView.Cells[1, 0].Value = 10; 
    FpSpread1.ActiveSheetView.Cells[2, 0].Formula = "A1 + A2"; 
    ex = dm.ParseFormula(2, 0, "A1+A2"); 
    o = dm.EvaluateExpression(2, 0, ex); Response.Write(o.ToString()); 
    Dim dm As FarPoint.Web.Spread.Model.DefaultSheetDataModel
    dm = FpSpread1.ActiveSheetView.DataModel
    Dim ex As FarPoint.CalcEngine.Expression
    Dim o As Object
    FpSpread1.ActiveSheetView.Cells(0, 0).Value = 10 
    FpSpread1.ActiveSheetView.Cells(1, 0).Value = 10 
    FpSpread1.ActiveSheetView.Cells(2, 0).Formula = "A1 + A2" 
    ex = dm.ParseFormula(2, 0, "A1+A2") 
    o = dm.EvaluateExpression(2, 0, ex)
    See Also