SpreadJS Documentation
setColumnDataFormula Method
The column index of the table. The index is zero-based.
The data range formula.
Sets a formula to the table's data range with the specified index.
Syntax
var instance = new GcSpread.Sheets.SheetTable(name, row, col, rowCount, colCount, style);
var value; // Type: SheetTable
value = instance.setColumnDataFormula(tableColumnIndex, formula);
function setColumnDataFormula( 
   tableColumnIndex : number,
   formula : string
) : SheetTable;

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.addTable("Table1", 0, 0, 4, 3, GcSpread.Sheets.TableStyles.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.findTableByName("Table1").setColumnDataFormula(2, "=[Value1]*[Value2]");
See Also

Reference

SheetTable type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.