Spread Windows Forms 6.0 Product Documentation
GetFormula Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : GetFormula Method


row
Row index of the cell
column
Column index of the cell

Glossary Item Box

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

Syntax

Visual Basic (Declaration) 
Public Function GetFormula( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As String
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim row As Integer
Dim column As Integer
Dim value As String
 
value = instance.GetFormula(row, column)
C# 
public string GetFormula( 
   int row,
   int column
)

Parameters

row
Row index of the cell
column
Column index of the cell

Return Value

String containing the formula

Remarks

This method returns the formula as a string; to return the formula as an Expression object, refer to the GetExpression method.

For more information on formulas, refer to the Formula Reference.

Example

This example illustrates the use of this member by returning the formula (as a string) for the specified row and column.
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 5);
object o;
fpSpread1.ActiveSheet.Models.Data = dataModel;
dataModel.SetValue(0, 0, 10);
dataModel.SetValue(1, 0, 20);
dataModel.SetFormula(0, 0, "3*SUM(A1, A2)");
o = dataModel.GetFormula(0, 0);
listBox1.Items.Add(o.ToString());
Visual BasicCopy Code
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 5)
Dim o As Object
FpSpread1.ActiveSheet.Models.Data = dataModel
dataModel.SetValue(0, 0, 10)
dataModel.SetValue(1, 0, 20)
dataModel.SetFormula(0, 0, "3*SUM(A1, A2)")
o = dataModel.GetFormula(0, 0)
ListBox1.Items.Add(o.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.