Skip to content

Replies

0
Matthew McAtamney-Gr
Matthew McAtamney-Gr answered on Aug 16, 2017 4:44 PM

This also does not work as by the time the export happens the image has not loaded and that a shape of 0 width and 0 height is added and leaves me with a blank cell.

Unfortunately this function does not allow me to even inject the code into the onload function as this is then not possible to wait on so that the export does not continue regardless and add no images.

0
Matthew McAtamney-Gr
Matthew McAtamney-Gr answered on Aug 16, 2017 2:10 PM

I seem to be experiencing this exact same issue:

TypeError: Cannot read property 'getHashCode' of null
This is using the 2017.1 release and the following code inside the "cellExported" delegate for GridExcelExporter:
// checking cell needs image transformation
//…

// empty the cell
args.xlRow.setCellValue(args.columnIndex, "");

var xlCell = args.xlRow.cells(args.columnIndex);

// load the image
var image = new Image(50, 50);
image.src = args.cellValue;
var imageShape = new $.ig.excel.WorksheetImage(image);

// insert image into the workbook
imageShape.topLeftCornerPosition({ x: 0.0, y: 0.0 });
imageShape.bottomRightCornerPosition({ x: 100.0, y: 100.0 });
imageShape.topLeftCornerCell(xlCell);
imageShape.bottomRightCornerCell(xlCell);
sender._worksheet.shapes().add(imageShape);

Any help on this issue would be great or is this just something that is not going to be supported?