External grid-to-pdf and grid-to-excel services allow to convert grid's data to PDF or Excel format directly on server-side: from any table without actually rendering data in the grid. Shortly, you should perform the following steps:
$convert = new ConvertService("http://dhtmlx.com/docs/products/devExchange/samples/grid2pdf_02/server/generate.php");
$convert = new ConvertService("http://dhtmlx.com/docs/products/devExchange/samples/grid2excel_02/server/generate.php");
$convert->pdf("some.pdf",false);
$convert->excel("some.xls",false);
Parameters:
Service automatically start to export data defined through GridConnector.
require("../../../codebase/grid_connector.php"); require("../../../codebase/convert.php"); //url to data conversion service $convert = new ConvertService("http://dhtmlx.com/docs/products/devExchange/samples/grid2pdf_02/server/generate.php"); $convert->pdf(); //equal to calling pdf("data.pdf", false) $grid = new GridConnector($res); $grid->set_config(new GridConfiguration()); //mandatory $grid->render_table("grid50"); //table name and optional list of fields
require_once("../../config.php"); $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); require("../../../codebase/grid_connector.php"); require("../../../codebase/convert.php"); //url to data conversion service $convert = new ConvertService("http://dhtmlx.com/docs/products/devExchange/samples/grid2excel_02/server/generate.php"); $convert->excel(); //equal to calling excel("data.xls", false) $grid = new GridConnector($res); $grid->set_config(new GridConfiguration()); //mandatory $grid->render_table("grid50"); //table name and optional list of fields