FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : LoadFormulas Method |
'Declaration Public Sub LoadFormulas( _ ByVal recalculate As Boolean _ )
public void LoadFormulas( bool recalculate )
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 and your 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.
fpSpread1.Sheets.Add(FarPoint.Win.Serializer.LoadObject(typeof(FarPoint.Win.Spread.SheetView), "C:\\SavedSheet.xml", RootNode")); fpSpread1.ActiveSheet.LoadFormulas(false);
FpSpread.Sheets.Add(FarPoint.Win.Serializer.LoadObject(GetType(FarPoint.Win.Spread.SheetView), "C:\SavedSheet.xml", RootNode")) FpSpread.ActiveSheet.LoadFormulas(True)
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