Spread Windows Forms 8.0 Product Documentation
ParseFormula Method (IExpressionSupport2)
Example 


Row index of the cell
Column index of the cell
Formula to be parsed to a string
Parses the string value and returns the expression for the cell at the specified row and column.
Syntax
'Declaration
 
Function ParseFormula( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal value As String _
) As Expression
'Usage
 
Dim instance As IExpressionSupport2
Dim row As Integer
Dim column As Integer
Dim value As String
Dim value As Expression
 
value = instance.ParseFormula(row, column, value)
Expression ParseFormula( 
   int row,
   int column,
   string value
)

Parameters

row
Row index of the cell
column
Column index of the cell
value
Formula to be parsed to a string

Return Value

Expression containing the parsed formula
Exceptions
ExceptionDescription
ParseException Value is not a valid formula.
Example
This example evaluates the expression and returns the resulting object for the cell at the specified row and column.
FarPoint.Win.Spread.Model.IExpressionSupport ems; 
ems = (FarPoint.Win.Spread.Model.IExpressionSupport)fpSpread1.ActiveSheet.Models.Data; 
fpSpread1.ActiveSheet.SetValue(0, 0, 5); 
fpSpread1.ActiveSheet.SetValue(1, 0, 5); 
ems.SetFormula(2, 0, "SUM(A1, A2)"); 
string s;
s = ems.GetFormula(2, 0);
FarPoint.CalcEngine.Expression exp;
FarPoint.Win.Spread.Model.IExpressionSupport2 es;
es = (FarPoint.Win.Spread.Model.IExpressionSupport2)fpSpread1.ActiveSheet.Models.Data;
exp = es.ParseFormula(2, 0, s);
MessageBox.Show("The parsed formula is " + exp.ToString());
Dim ems As FarPoint.Win.Spread.Model.IExpressionSupport
ems = FpSpread1.ActiveSheet.Models.Data
FpSpread1.ActiveSheet.SetValue(0, 0, 5)
FpSpread1.ActiveSheet.SetValue(1, 0, 5)
ems.SetFormula(2, 0, "SUM(A1, A2)")
Dim s As String
s = ems.GetFormula(2, 0)
Dim exp As FarPoint.CalcEngine.Expression
Dim es As FarPoint.Win.Spread.Model.IExpressionSupport2
es = FpSpread1.ActiveSheet.Models.Data
exp = es.ParseFormula(2, 0, s)
MessageBox.Show("The parsed formula is " & exp.ToString())
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

IExpressionSupport2 Interface
IExpressionSupport2 Members

 

 


Copyright © GrapeCity, inc. All rights reserved.