Functions Library
ICalcData Interface
Essential Calculate lets you add calculation support to objects by implementing an interface, ICalcData. CalcQuick and CalcDataGrid both implement ICalcData, which gives them their calculation support. ICalcData is designed around a rectangular array of data. This rectangular design can be hidden, just as in CalcQuick.
Methods and Events
There are four members of the ICalcData interface, three methods and one event.
feature image
ICalcData Interface
Two of the methods are used to get and set values, one method gives you access to the object after it has been created, and the event is used to notify listeners when values change.
Use with Arbitrary Objects
Use CalcQuick to add calculation support to just about anything. You can register values or formulas using an indexer on the CalcQuick object. Following this, the act of retrieving a value through the CalcQuick indexing triggers the calculation.
A single command can add calculation support to a collection of text box and combo box controls.
The following code sample allows you to enter a value in one text box and automatically display the computed values in other text boxes.
feature image
Specifying Related Controls
Automatic and Manual Calculations
Properties let you control whether changes to values tracked by a CalcEngine object automatically trigger dependent calculations. Turning off this auto-calculation support lets you quickly change many values and then do the calculation only when all updates are completed.
Calculations
The CalcDataGrid class enables support for calculations on a Windows Forms data grid. It allows you to use Excel-like formulas to calculate values that depend on other cells' values.
Cross-Grid References
Essential Calculate can manage multiple data-bound grid objects. You can also have have formulas with reference values from one grid in another grid.
Essential Calculate also provides support for sheet ranges. Setting the CalcEngine.SupportsSheetRanges property to True makes the engine support sheet ranges such as "=SUM(Sheet1:Sheet3!A1)" and "=SUM(Sheet1:Sheet3!A1:B4)".
Custom Functions
You can add functions by writing a method that defines the calculation and registering a delegate for this method with Essential Calculate. The class library has helper methods that can be used to retrieve lists of values and compute formulas, if needed, to manage custom functions.
Helper methods can also be directly accessed to parse and compute formulas for use in code.
List of Functions
Essential Calculate contains a library of more than 150 functions ready for your use. The functions used range from standard mathematical functions such as cosine and sine, to statistical functions like averages and standard deviations, and even financial functions (declining balance and future value, for example).
feature image
Underlying Mathematics
feature image
Underlying Mathematics
::adCenter::