Spread Windows Forms 6.0 Product Documentation
EvaluateExpression Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.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 expression

Example

This example evaluates the expression and returns the object.
C#Copy Code
FarPoint.CalcEngine.Expression ex;
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(10, 10);
dataModel.AddCustomName("TWICESUM", new FarPoint.CalcEngine.DoubleExpression(10));
dataModel.SetFormula(1, 1, "TWICESUM");
fpSpread1.ActiveSheet.Models.Data = dataModel;
ex = dataModel.GetExpression(1, 1);
dataModel.EvaluateExpression(1, 1, ex);
MessageBox.Show("The expression is " + ex.ToString());
Visual BasicCopy Code
Dim ex As FarPoint.CalcEngine.Expression
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(10, 10)
dataModel.AddCustomName("TWICESUM", New FarPoint.CalcEngine.DoubleExpression(10))
dataModel.SetFormula(1, 1, "TWICESUM")
FpSpread1.ActiveSheet.Models.Data = dataModel
ex = dataModel.GetExpression(1, 1)
dataModel.EvaluateExpression(1, 1, ex)
MessageBox.Show("The expression is " & ex.ToString())

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.