Error resulting from gridPdfGenerator.php

I am getting the following result on my screen instead of getting the expected pdf:

codebase/gridPdfGenerator.php at 172 : Undefined offset: 8

Any idea on what I am doing wrong? Thank you.

Are you exporting data from client side grid or directly from data feed?
In case of client side grid - can you provide js code which was used for grid initialization, as it seems that somehow incorrect configuration structure was sent for conversion.

Is this what you need? Thanks

	function doOnLoad(){
		rprintGrid = new dhtmlXGridObject('rprintGrid_container');
		rprintGrid.setImagePath("codebase/imgs/");
		rprintGrid.setHeader("Notes for SG week " + weekno + " ending " + date + ",#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan");
		rprintGrid.attachHeader(",date,time,wk,callup,lost?,company,contact,notes,kenlist");
		rprintGrid.setColumnIds(",date,time,wk,callup,islost,company,contact,notes,kenlist");
		var colrprintCallup=rprintGrid.getColIndexById("callup");
		var colrprintCompany=rprintGrid.getColIndexById("company");
		rprintGrid.setInitWidths("20,60,50,30,60,40,70,70,*,60");
		rprintGrid.setColAlign("left,left,left,left,left,left,left,left,left,right");
		rprintGrid.setColTypes("ch,ed,ro,ed,ed,ch,ed,ro,ro,ro");
		rprintGrid.setEditable(true);
		rprintGrid.enableEditEvents(false, true, false); //enableEditEvents(click, dblclick, f2Key)
		rprintGrid.setSkin("modern");
		rprintGrid.setColSorting("na,str,str,str,str,str,str,str,str,str"); //allows columns to be sorted
		rprintGrid.enableMultiline(true);
		rprintGrid.groupBy(colrprintCompany,["#title","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan"]);
		rprintGrid.setColumnHidden(colrprintCallup,true);
		rprintGrid.setColumnHidden(colrprintCompany,true);
		rprintGrid.init();
		rprintGrid.loadXML("./xml/btxrprintxml.php?useweekno="+weekno);
		var dp = new dataProcessor("./xml/btxrprintxml.php");
		dp.init(rprintGrid);
		dp.styles = {
			updated: "font-weight:bold; font-style:italic; color:green;",
		}
	}
</script>
<?php include ('./includes/btxheader2.php'); ?>

Yep, this is the necessary peace of code.
I will try to repeat the same problem locally and will contact you when results will be available.

Hi, please, replace line 172 in gridPdfGenerator.php with the follow code:

for ($k = 1; $k < $this->columns[$i][$j]['colspan'] && $k+$j < count($widths); $k++) {

Ok, it works, mostly. However, before I made the change, I tested it one more time… and it already worked. I went ahead and also made the suggested change… and it still worked. So, I don’t understand the reasons for this, but progress is being made.

The resulting pdf output I get is very close to being correct. What it is lacking is the grouping headers. My grid displays the data in groups, with group headers. But the pdf does not show the group headers.

It may be that the answer to this issue is elsewhere in the forum, so I will look. If you don’t think the answer is there and you know what to do, I could use more help.

Thanks!

I was unable to find an answer in the forum. So, I guess I need help:
How do I get group headers in my grid to show up in my pdf?

Hi,
unfortunately grid-export doesn’t support exporting group headers.