GridJs GridAbstractCalculationEngine Calculate event how to get GridReferredArea values

Hi,

Say I have a user-defined function:
=Foo(Sheet1!A1)

Since I am passing a range, the parameter is a GridReferredArea.
How do I get the actual values of the referred areas to use in the custom function?

Thanks!
Dean

hi, @Moonglum
the below code is an example

class MyCalculation : GridAbstractCalculationEngine
{
public override void Calculate(GridCalculationData data)
{
//switch (data.FunctionName)
//{
// case “DR.GET”:
// data.CalculatedValue = 3000;
// break;
// case “DR.GET2”:
// data.CalculatedValue = 5000;
// break;
//}
//here you can get the GridReferredArea object
GridReferredArea area=(GridReferredArea )data.GetParamValue(0);

            Console.WriteLine(data.Formula+" , value:"+data.Value+",string value:"+data.StringValue);
            //data.CalculatedValue = data.Value;
            String newValue = data.Value.ToString();
            if (newValue == null || String.IsNullOrWhiteSpace(newValue))
                newValue = data.StringValue;
            if (String.IsNullOrWhiteSpace(newValue))
                newValue = "Missing";
            data.CalculatedValue = newValue;
        }
    }

you can find document for the topic in the below:

you can find document for the GridReferredArea in the below:
Class GridReferredArea | Aspose.Cells for .NET API Reference