Connector 1.0+ allows to use MsExcel file as datasource, you can load data from excel file in any component ( grid, chart, dataview, combo , scheduler )
To start using this feature you need to download libExcel - which is standalone project and not included in the connector's package You can grab it from here http://support.dhtmlx.com/x-files/connector/phpExcel.zip or from author's site http://www.codeplex.com/PHPExcel - unzip lib to the connector's folder.
Connector file will look as
//files from ligExcel package require_once('lib/PHPExcel.php'); require_once('lib/PHPExcel/IOFactory.php'); //connectors require("../../codebase/db_excel.php"); require("../../codebase/grid_connector.php"); $grid = new GridConnector("../some.xls", "ExcelDBDataWrapper"); $grid->render_table("A18:F83", "id", "A,B,C,D,E,F");
Constructor
render_table
$grid->render_table("A18:F83", "id", "A,B,C,D,E,F");
$grid->render_table("A1", "id", "A,B,C,D,E,F");
$grid->render_table("*", "id", "A,B,C,D,E,F");
If you want to load both data and header from excel file, it can be done by using GridConfiguration
$grid = new GridConnector($excel_file, "Excel"); $config=new GridConfiguration(); //array of cells, with labels for grid's header $config->setHeader($grid->sql->excel_data(array("A3","B3","F13"))); $grid->set_config($config); $grid->render_table("A18", "id", "A,B,F");