APPLICABLE TO: Grid
External grid-to-pdf and grid-to-excel services allow converting grid's data to PDF or Excel format directly on the server side: from any table without actually rendering data in the grid. Shortly, you should perform the following steps:
$convert = new ConvertService("http://dhtmlxgrid.appspot.com/export/pdf");
$convert = new ConvertService("http://dhtmlxgrid.appspot.com/export/excel");
$convert->pdf("some.pdf",false);
$convert->excel("some.xls",false);
Parameters:
The service automatically starts exporting data defined through GridConnector.
require("../../../codebase/grid_connector.php");
require("../../../codebase/convert.php");
//url to data conversion service
$convert = new ConvertService("http://dhtmlxgrid.appspot.com/export/pdf");
$convert->pdf(); //equal to calling pdf("data.pdf", false)
$grid = new GridConnector($res);
$grid->set_config(new GridConfiguration()); //mandatory
$grid->render_table("grid50"); //a table's name and an optional list of fields
require_once("../../config.php");
$res= new PDO("mysql:dbname=$mysql_db;host=$mysql_server",$mysql_user,$mysql_pass);
require("../../../codebase/grid_connector.php");
require("../../../codebase/convert.php");
//url to data conversion service
$convert = new ConvertService("http://dhtmlxgrid.appspot.com/export/excel");
$convert->excel(); //equal to calling excel("data.xls", false)
$grid = new GridConnector($res);
$grid->set_config(new GridConfiguration()); //mandatory
$grid->render_table("grid50"); //a table's name and an optional list of fields