SpreadJS 14
GC.Spread.Sheets Namespace / Worksheet type / getFormula Method
The row index.
The column index.
The sheet area. If you do not provide this parameter, it defaults to viewport.
In This Topic
    getFormula Method
    In This Topic
    Gets the formula in the specified cell in this sheet.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: string
    value = instance.getFormula(row, col, sheetArea);
    function getFormula( 
       row : number,
       col : number,
       (optional) sheetArea : SheetArea
    ) : string;

    Parameters

    row
    The row index.
    col
    The column index.
    sheetArea
    The sheet area. If you do not provide this parameter, it defaults to viewport.

    Return Value

    Returns the formula string.
    Example
    This example returns the formula in the specified cell.
    activeSheet.setValue(0,0,1);
    activeSheet.setValue(0,1,2);
    activeSheet.setValue(0,2,10);
    activeSheet.getCell(1,1).formula("=SUM(A1:C1)");
    var formula = activeSheet.getFormula(1,1);
    alert(formula);
    See Also

    Reference

    Worksheet type