Spread ASP.NET 6.0 Product Documentation
EvaluateExpression Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : EvaluateExpression Method


row
Row index of the base cell
column
Column index of the base cell
expression
Expression to be evaluated

Glossary Item Box

Evaluates the expression in the cell at the specified row and column and returns the resulting object.

Syntax

Visual Basic (Declaration) 
Public Function EvaluateExpression( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal expression As Expression _
) As Object
Visual Basic (Usage)Copy Code
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)
C# 
public object EvaluateExpression( 
   int row,
   int column,
   Expression expression
)

Parameters

row
Row index of the base cell
column
Column index of the base cell
expression
Expression to be evaluated

Return Value

Object containing the evaluated result

Example

This example evaluates the specified expression.
C#Copy Code
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()); 
Visual BasicCopy Code
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)
Response.Write(o.ToString()) 

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.