See Also

IWorkbookSet Interface  | IWorkbookSet Members  | Calculation Property  | BackgroundCalculation Property  | Calculate Method  | CalculateFull Method  | CalculateFullRebuild Method

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages SpreadsheetGear The Performance Spreadsheet Component Company 

CalculationOnDemand Property

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.

[Visual Basic]
Overridable Property CalculationOnDemand As Boolean
[C#]
virtual bool CalculationOnDemand {get; set;}
[C++]
__property virtual bool get_CalculationOnDemand(); __property virtual void set_CalculationOnDemand(    bool value );
[C++/CLI]
virtual property bool CalculationOnDemand {    bool get();    void set (bool value); }

Remarks

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

  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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IWorkbookSet Interface  | IWorkbookSet Members  | Calculation Property  | BackgroundCalculation Property  | Calculate Method  | CalculateFull Method  | CalculateFullRebuild Method

 

 


See our live Excel Reporting, Excel Charting, Excel to DataGrid and Excel Calculation Samples.

Copyright © 2003-2007 SpreadsheetGear LLC. All Rights Reserved.

SpreadsheetGear and Spreadsheet Gear are trademarks of SpreadsheetGear LLC.