Error message "Undefined offset: 1"

I am using filter in grid. Like


//set title filter field
//set author filter field
var authFlt = document.getElementById(“author_flt”).appendChild(document.getElementById(“author_flt_box”).childNodes[0]);
//block sorting and resize actions for second row

When I try to export to PDF it generate
“C:\AppServ\www\dhtmlxGrid\server\gridPdfGenerator.php at 170 : Undefined offset: 1”
message. Without having the Filter coding it works fine.


Could you provide grid_load.php content?
By the way, make sure you are using the last export script version

Hi Radyno ,

Thank you for your reply. I will check it and come back to you.


Mathy :slight_smile:

I have a similar problem.
C:\Inetpub\extras\shoah\resources\dhtmlx\ext\exportpdf\gridPdfGenerator.php at 236 : Undefined offset: 10

You may see the page at:
If it’s all greek to you, just click the PDF link at the list!

By the way, on the same page the export to Excel does not work at all.

I use the dhtmlxgrid_export.js script from:
and the engines from:

It looks like you have too much #cspan elements in line:

mygrid.attachEvent("onXLE", function() { mygrid.attachFooter("Βρέθηκαν "+mygrid.getRowsNum()+" εγγραφές που ικανοποιούν τα κριτήρια που θέσατε,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan", ["text-align: left;"]); });

Try to remove two or three such elements, this might help you.

As I remove the #cspan from the footer the error remains, lowering the offset.

The point of the many #cspan is that the complete message should appear in a single line. This message states the number of records returned from the database. If you can point me on how to include that in the navigation (e.g. it now says “records 1 to 20”, to change it to "records 1 to 20 from 250) I can do without the footer.

But even if I comment out the footer the error does not go away:
C:\Inetpub\extras\shoah\resources\dhtmlx\ext\exportpdf\gridPdfWrapper.php at 141 : Undefined offset: 0

Update dhtmlxGridGenerator.php from attachment, please.

To improve grid appearance in PDF open dhtmlxgrid_export.js file and comment the follow line like here:

// if (empty_cols != grid._cCount)
	xml+="\n<columns>"+cxml+"</columns>"; (3.01 KB)

Excellent! It now works and displays perfectly.

The Excel export still doesn’t work. The debug.xml displays the data and has no errors in it.

Please, modify generate.php file (for excel export) like here:


require_once 'gridExcelGenerator.php';
require_once 'gridExcelWrapper.php';

$debug = true;
//$error_handler = set_error_handler("PDFErrorHandler");

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