Problem with toPdf

hi, i have a strange problem with generate.php when i try to make a pdf from a grid…

the script is working on my local test server but this problem occurs on the production server:

generate.php at 11 : Undefined index: grid_xml

pls. help me what could cause this error, thx

Try to update dhtmlxgrid_export.js file.
dhtmlxgrid_export.zip (2.63 KB)

hi Olga, thank you for your answer. i have updated the file, but the problem is still persists. anyway, the problem only happens with big pdfs (actually the pdf is 25 pages now)

the post size for grid_xml: 740223 bytes

now in the test server i get the following error (in this server it was working before the update)

generate.php at 20 : simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, ‘<’ not found

Hi.
Try to update also generate.php file.
generate.zip (520 Bytes)

hi Radyno,

thank you. it is working on the test server but still not in the production server. now it gives no error text but a blank white page. the script also gives an error_report_2011_04_20__11_01_45.xml file without any content.

it is something about the size of the grid. when it is small it is working on the production server as well.

  1. Try to set bigger values for max_upload_size in php.ini.

  2. Go to gridPdfWrapper.php, find line

$this->cb->Output('grid.pdf', 'I');

and modify it like here:

$this->cb->Output('grid.pdf', 'F');

Then try to export your grid. New file with name grid.pdf may appear in the same directory. Is it correct?

  1. If problem still occurs attach here generated error report.
  1. upload/post size: 40M/30M should be enough
  2. done
  3. error_report_2011_04_20__12_14_28.xml -> 0 length

no grid.pdf apperars

Modify function PDFErrorHandler in file generate.php like here

function PDFErrorHandler ($errno, $errstr, $errfile, $errline) {
	global $xmlString;
	if ($errno < 1024) {
		error_log($xmlString, 3, 'error_report_'.date("Y_m_d__H_i_s").'.xml');
		echo $errfile." at ".$errline." : ".$errstr;
		exit(1);
	}

}

After that try to export grid. Does any error occur?

generate.php at 11 : Undefined index: grid_xml

i have enabled debug mode. pls. find attached error log file.
error_report_2011_04_20__21_47_02.zip (1.73 KB)

It looks like problem is on the client side. Could you tell me how do you initialize grid?
It would be useful to look at code. Or maybe your grid is available over the Internet and I can try to export it myself?

hi unfortunately it is a closed system but i can provide initialization code:

var rak_dob_xml = webshop_gy+'rak_dob_connector.php';
var rak_dob = new dhtmlXGridObject("rak");
rak_dob.setImagePath(imgp);
rak_dob.imgURL = imgp;
rak_dob.setEditable(true);
rak_dob.setSkin(gskin);
rak_dob.selMultiRows = false;
rak_dob.setHeader("Cikktörzs,Cikkszám,ME,Készleten/Foglalt/Beérkezés,Beszerzési Nettó érték");
rak_dob.attachHeader('<input class="rak_dob" style="width:440px;" id="f_cnev" name="f_cnev" type="text">,<input class="rak_dob" style="width:90px;" id="f_cikksz" name="f_cikksz" type="text">');
rak_dob.setInitWidths("450,150,80,200,150");
rak_dob.setColTypes("tree,ro,ro,ro,ro");
rak_dob.setColAlign("left,right,right,right,right");
rak_dob.enableSmartRendering(true);
rak_dob.enableSmartXMLParsing(false);
rak_dob.enableDragAndDrop(true);
rak_dob.enableMultiline(false); 
rak_dob.init();

should i attach the generated xml as well? problem might be with the xml file?

Hi.
It would be useful to have your generated data.
I’ve tried to repeat your problem locally but it works without any problems.

the problem was php register globals turned on the server.

turning off solved the problem by getting the post variable intact.