Spread Windows Forms 6.0 Product Documentation
UnparseFormula Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > IExpressionSupport2 Interface : UnparseFormula Method


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

Glossary Item Box

Gets the formula, as a string value, for the specified expression for the cell at the specified row and column.

Syntax

Visual Basic (Declaration) 
Function UnparseFormula( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal expression As Expression _
) As String
Visual Basic (Usage)Copy Code
Dim instance As IExpressionSupport2
Dim row As Integer
Dim column As Integer
Dim expression As Expression
Dim value As String
 
value = instance.UnparseFormula(row, column, expression)
C# 
string UnparseFormula( 
   int row,
   int column,
   Expression expression
)

Parameters

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

Return Value

String containing the formula

Example

This example evaluates the expression and returns the resulting object for the cell at the specified row and column.
C#Copy Code
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());
string ret;
ret = es.UnparseFormula(2, 0, exp);
MessageBox.Show("The unparsed formula is " + ret);
Visual BasicCopy Code
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)
Response.Write("The parsed formula is " & exp.ToString())
Dim ret As String
ret = es.UnparseFormula(2, 0, exp)
MessageBox.Show("The unparsed formula is " & ret)

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.