SpreadsheetGear
CalculationOnDemand Property
See Also  Send Feedback
SpreadsheetGear Namespace > IWorkbookSet Interface : CalculationOnDemand Property

Gets or sets the property which determines whether individual cells are calculated on demand. This feature is turned off by default.

Syntax

Visual Basic (Declaration) 
Property CalculationOnDemand As Boolean
C# 
bool CalculationOnDemand {get; set;}

Remarks

Calculation on demand is a feature of SpreadsheetGear which can dramatically increase performance of some applications. There are four primary strategies for calculating cells in SpreadsheetGear:

  1. Set Calculation to Calculation.Manual and call Calculate to calculate a workbook set.
  2. Set Calculation to Calculation.Automatic and set CalculationOnDemand to false (the default settings of a workbook set). With these settings, retrieving the value of a formula cell which needs to be calculated will result in the calculation of a logical group of cells all at once. This might be a column of cells, a worksheet, a workbook or the entire workbook set.
  3. Set Calculation to Calculation.Automatic and set CalculationOnDemand to true. With these settings, retrieving the value of a formula cell which needs to be calculated will result in the calculation of only the specified cell and the cells on which it depends.
  4. Mix #2 or #3 with calls to Calculate when it is appropriate.

Suppose you have a workbook where you have 100 rows and three columns. Columns A and B have a number, column C adds A + B. If you will be working within one row at a time, changing numbers in columns A and B, and retrieving the result of the formula in column C, calculation on demand will perform very well.

If, on the other hand, you will be making changes in columns A and B, and retrieving many of the cells in column C, turning off calculation on demand may perform better.

If you know that you will need all cells in a workbook set to be calculated, the most efficient strategy is to call Calculate before you start to retrieve the results of formula cells.

CalculationOnDemand has no effect if automatic calculation is not enabled by setting Calculation to Calculation.Automatic.

Requirements

Platforms: Windows 2000, Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2008. SpreadsheetGear 2009 requires the Microsoft .NET Framework 2.0 and supports .NET 3.0 and .NET 3.5.

See Also

Copyright © 2003-2009 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.