GridAbstractCalculationEngine

GridAbstractCalculationEngine class

Represents user’s custom calculation engine to extend the default calculation engine of Aspose.Cells.

public abstract class GridAbstractCalculationEngine

Methods

Name Description
abstract Calculate(GridCalculationData) Calculates one function with given data.

Examples

[C#]
public class MyEngine : GridAbstractCalculationEngine
{
    public override void Calculate(GridCalculationData data)
    {
        string funcName = data.FunctionName.ToUpper();
        if ("MYFUNC".Equals(funcName))
        {
            //do calculation for MYFUNC here
            int count = data.ParamCount;
            object res = null;
            for (int i = 0; i < count; i++)
            {
                object pv = data.GetParamValue(i);
                if (pv is ReferredArea)
                {
                    ReferredArea ra = (ReferredArea)pv;
                    pv = ra.GetValue(0, 0);
                }
                //process the parameter here
                //res = ...;
            }
            data.CalculatedValue = res;
        }
    }
}

See Also