Spread.Sheets Documentation
addFromDataSource Method
The table name.
The row index.
The column index.
The data source for the table.
The style of the table.
The initialization options of the table.
* options.showHeader boolean Whether to display a header.
* options.showfooter boolean Whether to display a footer.
Adds a range table with a specified data source to the sheet.
Syntax
var instance = new GC.Spread.Sheets.Tables.TableManager(sheet);
var value; // Type: Table
value = instance.addFromDataSource(name, row, column, dataSource, style, options);
function addFromDataSource( 
   name : string,
   row : number,
   column : number,
   dataSource : object,
   style : TableTheme,
   options : Object
) : Table;

Parameters

name
The table name.
row
The row index.
column
The column index.
dataSource
The data source for the table.
style
The style of the table.
options
The initialization options of the table.
* options.showHeader boolean Whether to display a header.
* options.showfooter boolean Whether to display a footer.

Return Value

The new table instance.
Example
This example creates a table.
var source = [
                { LastName: "Freehafer", FirstName: "Nancy", Title: "Sales Representative", Phone: "(123)555-0100"},
                { LastName: "Cencini", FirstName: "Andrew", Title: "Vice President, Sales", Phone: "(123)555-0101"},
                { LastName: "Kotas", FirstName: "Jan", Title: "Sales Representative", Phone: "(123)555-0102"},
                { LastName: "Sergienko", FirstName: "Mariya", Title: "Sales Representative", Phone: "(123)555-0103"},
            ];
            
            activeSheet.tables.addFromDataSource("Table1", 5, 2, source, GC.Spread.Sheets.Tables.TableThemes.dark1);
See Also

Reference

TableManager type
Creating Tables

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.