nexar
#1
I am interested in using the export to pdf function as explained in the dhtmlxConnector Usage Guide and have some questions please:
1 In your PDF (php) example code how does the $convert get connected with $grid?
2 Can I use GridConfiguration and ConvertService but get my data from a Ruby On Rails server? If yes how would I do that?
- Do you have any Samples php for showing Export data or even of Grid to PDF?
Thanks in advance
Purvez
radyno
#2
Hi.
- ConvertService class automatically takes connector object, because usually just one Connector object is used in script.
- You could use your own script to generate grid xml. After that you should call convert method like here:
$convert->convert(null, $xml);
- Sample code:
<?php
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");
$convert = new ConvertService("http://192.168.1.16/dhtmlxdev/ExportTools/grid2pdf/generate.php","test.pdf",false);
$grid = new GridConnector($res);
$grid->set_config(new GridConfiguration());
$grid->render_table("grid50");
?>