[]
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.
Below the code you have already added, add the following code:
// Set formula for calculating balance.
FpSpread1.Sheets[0].ReferenceStyle = FarPoint.Web.Spread.Model.ReferenceStyle.R1C1;
FpSpread1.Sheets[0].Cells[0, 7].Formula = "RC[-1]-RC[-2]";
for (int i = 1; i < 99; i++)
{
FpSpread1.Sheets[0].Cells[i, 7].Formula = "R[-1]C-RC[-2]+RC[-1]";
}
' Set formula for calculating balance.
FpSpread1.Sheets(0).ReferenceStyle = FarPoint.Web.Spread.Model.ReferenceStyle.R1C1
FpSpread1.Sheets(0).Cells(0, 7).Formula = "RC[-1]-RC[-2]"
Dim i As Integer
For i = 1 To 99
FpSpread1.Sheets(0).Cells(i, 7).Formula = "R[-1]C-RC[-2]+RC[-1]"
Next
Save your project, then from the Debug menu choose Start to run your project.
Your ASP.NET page should look similar to the following picture. Type data into your checkbook register to test it and see how it operates. Click on the checkmark icon to save the changes or set the ClientAutoCalculation property for the control to True.
Your checkbook register is complete! You have completed this tutorial.