Spread Windows Forms 9.0 Product Documentation
RecalculateAll Method (ICalculationSupport)
Example 


Evaluates all the formulas in the sheet (including those that have not changed since the last calculation cycle).
Syntax
'Declaration
 
Sub RecalculateAll() 
'Usage
 
Dim instance As ICalculationSupport
 
instance.RecalculateAll()
void RecalculateAll()
Example
This example recalculates all the formulas in the sheet (regardless of whether they have changed since the last calculation cycle).
DialogResult dlg;
FarPoint.Win.Spread.Model.ICalculationSupport cs;
fpSpread1.ActiveSheet.SetValue(0, 0, 20);
fpSpread1.ActiveSheet.SetValue(0, 1, 10);
fpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)");
fpSpread1.ActiveSheet.SetFormula(4, 0, "A1*B1");
dlg = MessageBox.Show("Do you want to recalculate the formula?", "Recalculate", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     fpSpread1.ActiveSheet.AutoCalculation = false;
     fpSpread1.ActiveSheet.SetValue(0, 1, 100);
     cs = (FarPoint.Win.Spread.Model.ICalculationSupport)fpSpread1.ActiveSheet.Models.Data;
     cs.RecalculateAll();
}
Dim dlg As DialogResult
Dim cs As FarPoint.Win.Spread.Model.ICalculationSupport
FpSpread1.ActiveSheet.SetValue(0, 0, 20)
FpSpread1.ActiveSheet.SetValue(0, 1, 10)
FpSpread1.ActiveSheet.SetFormula(3, 0, "SUM(A1,B1)")
FpSpread1.ActiveSheet.SetFormula(4, 0, "A1*B1")
dlg = MessageBox.Show("Do you want to recalculate the formulas?", "RecalculateAll", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     FpSpread1.ActiveSheet.AutoCalculation = False
     FpSpread1.ActiveSheet.SetValue(0, 1, 100)
     cs = FpSpread1.ActiveSheet.Models.Data
     cs.RecalculateAll()
End If
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ICalculationSupport Interface
ICalculationSupport Members

 

 


Copyright © GrapeCity, inc. All rights reserved.