Your checkbook register is now set up to look like a checkbook register; however, it does not balance the currency figures you enter in the register. This step sets up the formula for balancing the figures.
C# |
Copy Code
|
---|---|
// Set formula for calculating balance. fpSpread1.Sheets[0].ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; int i; for (i = 0; i <= fpSpread1.ActiveSheet.RowCount - 1; i++) { if (i == 0) fpSpread1.Sheets[0].Cells[i, 7].Formula = "RC[-1] - RC[-2]" ; else fpSpread1.Sheets[0].Cells[i, 7].Formula = "RC[-1] - RC[-2] + R[-1]C"; } |
VB |
Copy Code
|
---|---|
' Set formula for calculating balance. fpSpread1.Sheets(0).ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 Dim i As Integer For i = 0 To fpSpread1.ActiveSheet.RowCount - 1 If i = 0 Then fpSpread1.Sheets(0).Cells(i, 7).Formula = "RC[-1] - RC[-2]" Else fpSpread1.Sheets(0).Cells(i, 7).Formula = "RC[-1]-RC[-2]+R[-1]C" End If Next |
Review the list of steps for Tutorial: Creating a Checkbook Register.