Spread Windows Forms 6.0 Product Documentation
LoadFormulas Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : LoadFormulas Method


recalculate
Whether to recalculate all the formulas in cells that have changed

Glossary Item Box

Loads formulas that are deserialized but not parsed yet, to be used after all sheets have been created and deserialized.

Syntax

Visual Basic (Declaration) 
Public Sub LoadFormulas( _
   ByVal recalculate As Boolean _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim recalculate As Boolean
 
instance.LoadFormulas(recalculate)
C# 
public void LoadFormulas( 
   bool recalculate
)

Parameters

recalculate
Whether to recalculate all the formulas in cells that have changed

Remarks

With the implementation of cross-sheet references in Spread, formulas can contain references to other sheets. If such formulas are loaded from a file, the Spread component must load sheets and formulas in a specific sequence for the cross-sheet references to work. The parsing of formulas loaded from a file must be delayed until all the sheets in the workbook have been loaded. The FpSpread.Open methods handle this automatically, loading the XML and parsing in the correct order.

If you have created custom deserialization code, then you have to be careful. If your custom code loads individual sheets and adds them to a workbook, then you will need to add code to parse the formulas after the sheet has been added to the workbook. This can be done with the FpSpread.LoadFormulas method for all the sheets in a Spread component. Using this method at the sheet level calls the method on all the data models for a particular sheet.

The code in the example below should be called after the code that loads the sheet and adds it to the workbook.

Example

This example uses the LoadFormulas method.
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetDataModel dm = default(FarPoint.Win.Spread.Model.DefaultSheetDataModel);
dm = (FarPoint.Win.Spread.Model.DefaultSheetDataModel)FarPoint.Win.Serializer.LoadObject(typeof(FarPoint.Win.Spread.Model.DefaultSheetDataModel), "c:\\test.xml", "rootnode");
dm.LoadFormulas(true);
fpSpread1.Sheets.Count = 1;
fpSpread1.Sheets[0].Models.Data = dm;
Visual BasicCopy Code
Dim dm As FarPoint.Win.Spread.Model.DefaultSheetDataModel
dm = FarPoint.Win.Serializer.LoadObject(GetType(FarPoint.Win.Spread.Model.DefaultSheetDataModel()), "c:\test.xml", "rootnode")
dm.LoadFormulas(True)
FpSpread1.Sheets.Count = 1
FpSpread1.Sheets(0).Models.Data = dm



Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.