Gets the formula, as a string value, for the cell of the specified row and column.
Syntax
Parameters
- row
- Row index of the cell
- column
- Column index of the cell
Return Value
String containing the formula
Remarks
Example
This example adds data to the first three columns along with formulas to sum the values. The GetFormula method returns the formula from the second column.
Visual Basic | Copy Code |
---|
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
If(Me.IsPostBack)ThenReturn
FpSpread1.ActiveSheetView.RowCount=10
DimiAsInteger
DimStrAsObject
Fori=0To3
FpSpread1.ActiveSheetView.SetValue(i,0,i)
FpSpread1.ActiveSheetView.SetValue(i,1,i)
FpSpread1.ActiveSheetView.SetValue(i,2,i)
Next
FpSpread1.ActiveSheetView.Cells(5,0).Formula="SUM(A3:A4)"
FpSpread1.ActiveSheetView.Cells(5,1).Formula="SUM(A3:A4)"
FpSpread1.ActiveSheetView.Cells(5,2).Formula="SUM(A3:A4)"
DimdmAsFarPoint.Web.Spread.Model.DefaultSheetDataModel=CType(FpSpread1.ActiveSheetView.DataModel,FarPoint.Web.Spread.Model.DefaultSheetDataModel)
Str=dm.GetFormula(5,1)
ListBox1.Items.Add(Convert.ToString(Str))
EndSub |
C# | Copy Code |
---|
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;
inti;
objectstr;
FpSpread1.ActiveSheetView.RowCount=10;
for(i=0;i<=3;i++)
{
FpSpread1.ActiveSheetView.SetValue(i,0,i);
FpSpread1.ActiveSheetView.SetValue(i,1,i);
FpSpread1.ActiveSheetView.SetValue(i,2,i);
}
FpSpread1.ActiveSheetView.Cells[5,0].Formula="SUM(A3:A4)";
FpSpread1.ActiveSheetView.Cells[5,1].Formula="SUM(A3:A4)";
FpSpread1.ActiveSheetView.Cells[5,2].Formula="SUM(A3:A4)";
FarPoint.Web.Spread.Model.DefaultSheetDataModeldm=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
str=dm.GetFormula(5,1);
ListBox1.Items.Add(Convert.ToString(str));
} |
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