SpreadJS Documentation
formulaToExpression Method
GC.Spread.Sheets Namespace > CalcEngine type : formulaToExpression Method
The context; in general, you should use the active sheet object.
The formula string.
The base row index of the formula.
The base column index of the formula.
Whether to use the r1c1 reference style.
Parse the specified formula to expression tree.
Syntax
var value; // Type: Expression
value = GC.Spread.Sheets.CalcEngine.formulaToExpression(context, formula, baseRow, baseColumn, useR1C1);
function formulaToExpression( 
   context : object,
   formula : string,
   baseRow : number,
   baseColumn : number,
   useR1C1 : boolean
) : Expression;

Parameters

context
The context; in general, you should use the active sheet object.
formula
The formula string.
baseRow
The base row index of the formula.
baseColumn
The base column index of the formula.
useR1C1
Whether to use the r1c1 reference style.

Return Value

The expression tree.
Example


var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 });
sheet = spread.getSheet(0);
sheet.setValue(0, 0, 1);
sheet.setValue(0, 1, 2);
sheet.setValue(0, 2, 3);
sheet.getCell(4, 4).formula("=SUM(A1:C1)");
var formula = sheet.getFormula(4, 4);
var expression = GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, formula, 0, 0);
console.log("Function Name is: " + expression.functionName);
Remarks

See Also

Reference

CalcEngine type