SpreadJS 13
GC.Spread.Sheets.Tables Namespace / Table type / setColumnDataFormula Method
The column index of the table. The index is zero-based.
The data range formula.
In This Topic
    setColumnDataFormula Method
    In This Topic
    Sets a formula to the table's data range with the specified index.
    Syntax
    var instance = new GC.Spread.Sheets.Tables.Table(name,
                                                    row,
                                                    col,
                                                    rowCount,
                                                    colCount,
                                                    style,
                                                    options,
                                                    options.showHeader,
                                                    options.showFooter,
                                                    options.useFooterDropDownList,
                                                    options.showResizeHandle);
    var value; // Type: Table
    value = instance.setColumnDataFormula(tableColumnIndex, formula);
    function setColumnDataFormula( 
       tableColumnIndex : number,
       formula : string
    ) : Table;

    Parameters

    tableColumnIndex
    The column index of the table. The index is zero-based.
    formula
    The data range formula.

    Return Value

    The table.
    Example
    This example uses a structured reference formula in the table.
    activeSheet.tables.add("Table1", 0, 0, 4, 3, GC.Spread.Sheets.Tables.TableTheme.dark1);
    activeSheet.getCell(0,0).text("Value1");
    activeSheet.getCell(0,1).text("Value2");
    activeSheet.getCell(0,2).text("Total");
    activeSheet.getCell(1,0).text("1");
    activeSheet.getCell(2,0).text("2");
    activeSheet.getCell(3,0).text("3");
    activeSheet.getCell(1,1).text("5");
    activeSheet.getCell(2,1).text("5");
    activeSheet.getCell(3,1).text("5");
    activeSheet.tables.findByName("Table1").setColumnDataFormula(2, "=[Value1]*[Value2]");
    See Also

    Reference

    Table type