FpSpread1.ActiveSheetView.RowCount = 10
FpSpread1.ActiveSheetView.ColumnCount = 6
For i As Integer = 0 To FpSpread1.ActiveSheetView.RowCount - 1
For j As Integer = 0 To 1
FpSpread1.ActiveSheetView.Cells(i, j).Value = i + j
Next
Next
FpSpread1.ActiveSheetView.Cells(0, 0).Value = 5
FpSpread1.ActiveSheetView.Cells(6, 2).Formula = "LINEST(B1:B3,A1:A3,TRUE,TRUE)"
Dim dm As FarPoint.Web.Spread.Model.DefaultSheetDataModel = TryCast(FpSpread1.ActiveSheetView.DataModel, FarPoint.Web.Spread.Model.DefaultSheetDataModel)
Dim expression As FarPoint.CalcEngine.Expression = dm.GetExpression(6, 2)
Dim value As FarPoint.CalcEngine.CalcArray = TryCast(dm.EvaluateExpression(6, 2, expression), FarPoint.CalcEngine.CalcArray)
If value IsNot Nothing Then
For i As Integer = 0 To value.RowCount - 1
For j As Integer = 0 To value.ColumnCount - 1
FpSpread1.ActiveSheetView.Cells(i, 3 + j).Value = value.GetValue(i, j)
Next
Next
End If