Export to PDF questions

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?

  1. Do you have any Samples php for showing Export data or even of Grid to PDF?

Thanks in advance

Purvez

Hi.

  1. ConvertService class automatically takes connector object, because usually just one Connector object is used in script.
  2. You could use your own script to generate grid xml. After that you should call convert method like here:
$convert->convert(null, $xml);
  1. 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");
?>